only persist once when changed

This commit is contained in:
Zutatensuppe 2020-12-13 01:09:12 +01:00
parent 6676dcc933
commit 5d76edafaf

View file

@ -67,6 +67,7 @@ function handleInput(gameId, playerId, input) {
function persistChangedGames() {
for (const game of GameCommon.getAllGames()) {
if (game.id in changedGames) {
delete changedGames[game.id]
fs.writeFileSync(`${DATA_DIR}/${game.id}.json`, JSON.stringify({
id: game.id,
puzzle: game.puzzle,