diff --git a/src/main.ts b/src/main.ts index b9551d3..eaf356e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,7 +40,7 @@ function clean_up() { log.info(`Cleaning up games...`); for (var code in active_games) { log.debug(`Writing game: ${code} to disk`); - log.silly(active_games[code]); + log.silly(active_games[code].toString()); // writeFileSync(`${db_dir}/${code}`, active_games[code].toJSON()); }; log.info(`Finished cleanup. Exiting.`); diff --git a/src/utils/Game.ts b/src/utils/Game.ts index 4f125d6..542bb8b 100644 --- a/src/utils/Game.ts +++ b/src/utils/Game.ts @@ -106,8 +106,7 @@ export class Game { }; public toString(): string { - let player_count = Object.keys(this._players).length; - return `Game(code=${this.code},players=${player_count})`; + return `Game(code=${this.code},players=${this.player_len})`; }; public toJSON(): string {