forked from tabarra/txAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
25 lines (23 loc) · 843 Bytes
/
main.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
//NOTE: declaring ANY variable in this file will pollute the global scope,
// and it will NOT be found in `Object.keys(global)`!
// This is why I'm doing some creative data juggling in some parts
//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
if(GetConvar('monitorMode', 'false') == 'true'){
try {
require('./src/index.js');
} catch (error) {
console.log('e'.repeat(80));
console.log(`Resource load error: ${error.message}`);
console.dir(error.stack);
console.log('e'.repeat(80));
}
}else if(GetConvar('txAdminServerMode', 'false') == 'true'){
require('./scripts/sv_logger.js');
}