1
0
mirror of https://github.com/hack-chat/main.git synced 2024-03-22 13:20:33 +08:00
hack-chat-main/server/main.js
2018-03-09 23:47:00 -08:00

35 lines
996 B
JavaScript

/**
* 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);