forked from tabarra/txAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.js
29 lines (27 loc) · 924 Bytes
/
entrypoint.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
//NOTE: Due to fxs's node, declaring ANY variable in this file will pollute
// the global scope, and it will NOT show in `Object.keys(global)`!
// Hence why I'm doing some data juggling and duplicated function calls.
//Check if running inside FXServer
try {
if (!IsDuplicityVersion()) throw new Error();
} catch (error) {
console.log('txAdmin must be run inside FXServer in monitor mode!');
process.exit();
}
//Checking monitor mode and starting
try {
if (GetConvar('monitorMode', 'false') == 'true') {
require('./core/index.js');
} else if (GetConvar('txAdminServerMode', 'false') == 'true') {
//Nothing, for now
}
} catch (error) {
//Prevent any async console.log messing with the output
process.stdout.write([
'e'.repeat(80),
`Resource load error: ${error.message}`,
error.stack.toString(),
'e'.repeat(80),
''
].join('\n'));
}