0
0
Fork 0

Update log messages

This commit is contained in:
Oliver-Akins 2021-01-07 12:36:13 -07:00
parent ffc4524127
commit 325a2cb423

View file

@ -9,18 +9,17 @@ export function processExit() {
* then if they do, we save the game to disk, if not we just delete it * then if they do, we save the game to disk, if not we just delete it
* completely from the system. * completely from the system.
*/ */
log.info(`Cleaning up games`) log.info(`Cleaning up games`);
for (var gc in games) { for (var gc in games) {
let game = games[gc]; let game = games[gc];
if (activeGame(game)) { if (game.ingame && activeGame(game)) {
game.log.debug(`Saving to datastore`); game.log.debug(`Saving to datastore`);
writeFileSync( writeFileSync(
`${conf.datastores.directory}/${game.id}.${conf.datastores.filetype}`, `${conf.datastores.directory}/${game.id}.${conf.datastores.filetype}`,
JSON.stringify(game.toJSON()) JSON.stringify(game.toJSON())
); );
} else { } else {
game.log.debug(`Deleting game`); game.log.debug(`Not saving to datastore`);
delete games[gc];
}; };
}; };
log.info(`Done cleaning up games`); log.info(`Done cleaning up games`);