2021-03-20 20:12:38 +01:00
|
|
|
// dotenv to keep secret variables in (they won't show on github)
|
|
|
|
require('dotenv').config();
|
|
|
|
|
2020-04-07 09:55:16 +02:00
|
|
|
//call new Server
|
|
|
|
global.WebSocket = require('ws');
|
|
|
|
global.EventEmitter = require('events').EventEmitter;
|
|
|
|
global.fs = require('fs');
|
|
|
|
global.createKeccakHash = require('keccak');
|
|
|
|
const AsyncConsole = require('asyncconsole')
|
|
|
|
|
|
|
|
global.isString = function(a){
|
|
|
|
return typeof a === 'string';
|
|
|
|
}
|
|
|
|
global.isBool = function(a){
|
|
|
|
return typeof a === 'boolean';
|
|
|
|
}
|
|
|
|
global.isObj = function(a){
|
|
|
|
return typeof a === "object" && !Array.isArray(a) && a !== null;
|
|
|
|
}
|
|
|
|
|
2020-04-07 23:02:35 +02:00
|
|
|
let Server = require("./src/Server.js");
|
2020-04-07 09:55:16 +02:00
|
|
|
let config = require('./config');
|
|
|
|
global.SERVER = new Server(config);
|
|
|
|
let console = process.platform == 'win32' ? new AsyncConsole("", input => {
|
|
|
|
try {
|
|
|
|
console.log(JSON.stringify(eval(input)));
|
|
|
|
} catch(e) {
|
|
|
|
console.log(e.toString());
|
|
|
|
}
|
|
|
|
}) : {};
|