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
* completely from the system.
*/
log.info(`Cleaning up games`)
log.info(`Cleaning up games`);
for (var gc in games) {
let game = games[gc];
if (activeGame(game)) {
if (game.ingame && activeGame(game)) {
game.log.debug(`Saving to datastore`);
writeFileSync(
`${conf.datastores.directory}/${game.id}.${conf.datastores.filetype}`,
JSON.stringify(game.toJSON())
);
} else {
game.log.debug(`Deleting game`);
delete games[gc];
game.log.debug(`Not saving to datastore`);
};
};
log.info(`Done cleaning up games`);