0
0
Fork 0

Export the conf from the main and add a games object

This commit is contained in:
Oliver-Akins 2020-12-24 21:59:11 -07:00
parent 561a3d28aa
commit 3c043862e8

View file

@ -1,9 +1,13 @@
import * as toml from "toml";
import { Logger } from "tslog";
import { readFileSync } from "fs";
import { Game } from "./objects/Game";
import startWebsocket from "./websocket";
import { Validate } from "./utils/validate";
let conf: config = toml.parse(readFileSync(`server.toml`, `utf-8`));
export const conf: config = toml.parse(readFileSync(`server.toml`, `utf-8`));
export var games: {[index: string]: Game} = {};
export const log: Logger = new Logger({
displayFunctionName: false,
@ -14,4 +18,6 @@ export const log: Logger = new Logger({
name: conf.log.name,
});
if (Validate.config(conf)) {
startWebsocket(conf);
}