add fireworks when game finished
This commit is contained in:
parent
f017499cbf
commit
1ac9be4307
3 changed files with 251 additions and 1 deletions
|
|
@ -23,7 +23,12 @@ function loadAllGames() {
|
|||
}
|
||||
const file = `${DATA_DIR}/${f}`
|
||||
const contents = fs.readFileSync(file, 'utf-8')
|
||||
const game = JSON.parse(contents)
|
||||
let game
|
||||
try {
|
||||
game = JSON.parse(contents)
|
||||
} catch {
|
||||
console.log(`[ERR] unable to load game from file ${f}`);
|
||||
}
|
||||
if (typeof game.puzzle.data.started === 'undefined') {
|
||||
game.puzzle.data.started = Math.round(fs.statSync(file).ctimeMs)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue