blob: 2e66cc1643bc576ea17b6a641478b362d18b6d7c (
plain)
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
|
/**
* HackChat main server entry point
*
* Version: v2.0.0
* Developer: Marzavec ( https://github.com/marzavec )
* License: WTFPL ( http://www.wtfpl.net/txt/copying/ )
*
*/
'use strict';
// import required classes
const Managers = require('./src/managers');
const wsServer = require('./src/core/server');
// initialize core reference
const core = {};
// load and initialize main manager classes
core.managers = {};
core.managers.dynamicImports = global.dynamicImports = new Managers.ImportsManager(core, __dirname);
core.managers.dynamicImports.init();
const configManager = core.managers.config = new Managers.Config(core, __dirname, core.managers.dynamicImports);
core.config = configManager.loadSync();
const commands = core.commands = new Managers.CommandManager(core);
commands.loadCommands();
const stats = core.managers.stats = new Managers.Stats(core);
stats.set('start-time', process.hrtime());
// initialize and start the server
const server = new wsServer(core);
|