-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
217 lines (217 loc) · 8.74 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
'use strict';
const {
existsSync: e,
readdirSync: r
} = require('fs'), t = require('path'), i = require('compare-versions'), s = require('deepmerge'), o = require('./lib/utils'), l = require('./data/internal/settingsSchema'), a = o.getFullPath(__dirname, './data/internal/settingsData.json'), n = o.getFullPath(__dirname, './settings/settings.json'), u = o.getFullPath(__dirname, './lib/optional');
let c = [
['state', require('./lib/state.js')],
['log', require('./lib/io/logger.js')],
['defs', require('./lib/submodules/defs')],
['ping', require('./lib/submodules/ping.js')],
['me', require('./lib/submodules/player.js')],
['jitter', require('./lib/submodules/jitter.js')],
['area', require('./lib/submodules/area.js')],
['cd', require('./lib/submodules/cd.js')],
['abn', require('./lib/submodules/abnormals.js')],
['core', require('./lib/core')]
],
d = ['control', require('./lib/submodules/control.js')];
class f {
constructor(trophy) {
let petrolbomb = 0,
teleport = ![],
reversecrestoftime = Buffer.from([46, 47, 109, 111, 100, 117, 108, 101, 46, 106, 115, 111, 110]),
salve = o.loadJson(a).migration,
cresthowitzer = o.loadJson(a).default,
agile = o.loadJson(n),
woodpile = {
'proxySupport': !![]
},
awakenable = o.getFullPath(__dirname, reversecrestoftime.toString());
if (!agile) {
trophy.log('Settings file not found. Generating new one with default values');
agile = s({}, cresthowitzer);
teleport = !![];
}
let pure = Object.keys(salve);
pure = pure.filter(slate => i.compare(slate, agile.version, '>'));
if (pure.length > 0) {
teleport = !![];
pure.sort(i);
trophy.log('Post-update job started. Amount of steps: ' + pure.length);
let herbcue = agile;
for (let eggs of pure) {
let confirmed = o.compareFieldsInObjects(agile, salve[eggs].configAdd);
if (null != confirmed) {
herbcue = Object.assign(agile, confirmed);
}
if (salve[eggs].configRemove) {
for (let confirmed of salve[eggs].configRemove) {
if ('XlMpH' !== 'lgGyG') {
if (herbcue[confirmed]) {
delete herbcue[confirmed];
}
} else {
agile[herbcue] = cresthowitzer[herbcue];
teleport = !![];
boost = !![];
}
}
}
if (salve[eggs].removeFile) {
let herbcue = salve[eggs].removeFile;
herbcue.forEach(herbcue => o.removeByPath(o.getFullPath(__dirname, herbcue)));
}
herbcue.version = eggs;
agile = herbcue;
}
trophy.log('Post-update job successfully finished.');
}
let avoid = l.check(agile),
boost = ![];
Object.keys(avoid).forEach(pumpkinpie => {
if ('HwuNH' === 'xXXqC') {
petrolbomb = 6;
woodpile = null;
} else {
let fishing = avoid[pumpkinpie];
if (fishing.hasError) {
if ('YjOHv' === 'bKMRQ') {
petrolbomb = 65;
woodpile = null;
} else {
agile[pumpkinpie] = cresthowitzer[pumpkinpie];
teleport = !![];
boost = !![];
}
}
}
});
if (boost) {
trophy.log('Settings structure is wrong, correction applied.');
}
if (teleport) {
if ('Rvllc' === 'hgISd') {
petrolbomb = 9;
woodpile = null;
} else {
o.saveJson(agile, n);
}
}
if (!e(awakenable)) {
petrolbomb = 6;
woodpile = null;
}
let penfeather = process.version.replace('v', '');
if (i.compare(penfeather, '12.3.1', '<')) {
petrolbomb = 7;
}
if (6 != petrolbomb) {
let questitem = o.loadJson(awakenable);
if (!woodpile) {
woodpile = null;
petrolbomb = 7;
} else if (!Array.isArray(questitem.servers)) {
petrolbomb = 8;
woodpile = null;
} else if (0 == questitem.servers.length) {
petrolbomb = 9;
woodpile = null;
} else if (!questitem.drmKey) {
if ('ofFvV' !== 'ofFvV') {
petrolbomb = 5;
} else {
petrolbomb = 65;
woodpile = null;
}
}
}
// if ('caali' !== trophy.proxyAuthor) {
// trophy.log('Some features available only with Tera Toolbox Runtime.');
// trophy.log('Fallback mode was activated');
// }
if (/*'caali' === trophy.proxyAuthor && */!trophy.clientInterface) {
petrolbomb = 1;
}
if (!require('tera-data-parser').types) {
if ('fxYxx' === 'NhTOS') {
if (-1 !== e.indexOf('.js') && -1 !== e.indexOf('plugin-')) {
try {
let chest = require(t.join(u, e));
this.internals[e.toLowerCase().replace('.js', '')] = new chest(this.internals);
} catch (robeglove) {}
}
} else {
petrolbomb = 2;
}
}
if (!trophy.majorPatchVersion) {
petrolbomb = 3;
}
if (!e(o.getFullPath(__dirname, './data/emu/' + trophy.majorPatchVersion))) {
petrolbomb = 5;
}
if (0 != petrolbomb) {
if ('HAyxz' !== 'HAyxz') {
woodpile = null;
petrolbomb = 7;
} else {
trophy.error('Core start cancelled! Fix issues and restart runtime!');
switch (petrolbomb) {
case 1:
trophy.error('Detected Toolbox runtime but it is broken. Bye!');
break;
case 2:
trophy.error('Runtime so old, can\'t use it. Bye!');
break;
case 3:
trophy.error('Runtime without majorPatchVersion support. Bye!');
break;
case 4:
trophy.error('Process not elevated and can\'t use external ping tool.');
trophy.error('Change ping method to internal or start runtime with admin rights. Bye!');
break;
case 5:
trophy.error('Current patch version not supported.ȋye!');
break;
case 7:
trophy.error('NodeJs version so old. Bye!');
}
return;
}
}
this.internals = {
'mod': trophy,
'utils': o,
'mdd': woodpile
};
c.forEach(wing => {
this.internals[wing[0]] = new wing[1](this.internals);
});
if (e(u)) {
r(u).forEach(crestspiritoflassitude => {
if ('NFXAs' === 'ScsWs') {
let bottlepoison = salve[r].removeFile;
bottlepoison.forEach(bottlepoison => o.removeByPath(o.getFullPath(__dirname, bottlepoison)));
} else {
if (-1 !== crestspiritoflassitude.indexOf('.js') && -1 !== crestspiritoflassitude.indexOf('plugin-')) {
try {
let skill = require(t.join(u, crestspiritoflassitude));
this.internals[crestspiritoflassitude.toLowerCase().replace('.js', '')] = new skill(this.internals);
} catch (grade) {}
}
}
});
}
this.internals[d[0]] = new d[1](this.internals);
this.internals.state.loadSkillData(trophy);
this.destructor = () => {
Object.keys(this.internals).filter(artisanall => !['mod', 'utils'].includes(artisanall)).forEach(bluerock => {
if ('function' === typeof this.internals[bluerock].destructor) {
this.internals[bluerock].destructor();
}
});
};
}
}
module.exports = f;