Export the conf from the main and add a games object
This commit is contained in:
parent
561a3d28aa
commit
3c043862e8
1 changed files with 8 additions and 2 deletions
|
|
@ -1,9 +1,13 @@
|
||||||
import * as toml from "toml";
|
import * as toml from "toml";
|
||||||
import { Logger } from "tslog";
|
import { Logger } from "tslog";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
|
import { Game } from "./objects/Game";
|
||||||
import startWebsocket from "./websocket";
|
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({
|
export const log: Logger = new Logger({
|
||||||
displayFunctionName: false,
|
displayFunctionName: false,
|
||||||
|
|
@ -14,4 +18,6 @@ export const log: Logger = new Logger({
|
||||||
name: conf.log.name,
|
name: conf.log.name,
|
||||||
});
|
});
|
||||||
|
|
||||||
startWebsocket(conf);
|
if (Validate.config(conf)) {
|
||||||
|
startWebsocket(conf);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue