fix finalizing in 'real' snapmode, fix reading newly created replays
This commit is contained in:
parent
3447681f10
commit
849d39dac2
5 changed files with 17 additions and 4 deletions
|
|
@ -848,6 +848,13 @@ function handleInput(
|
|||
changePlayer(gameId, playerId, { d, ts })
|
||||
_playerChange()
|
||||
}
|
||||
|
||||
if (snapped && getSnapMode(gameId) === SnapMode.REAL) {
|
||||
if (getFinishedPiecesCount(gameId) === getPieceCount(gameId)) {
|
||||
changeData(gameId, { finished: ts })
|
||||
_dataChange()
|
||||
}
|
||||
}
|
||||
if (snapped && onSnap) {
|
||||
onSnap(playerId)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ const get = (
|
|||
}
|
||||
|
||||
const log = fs.readFileSync(file, 'utf-8').split("\n")
|
||||
return log.map(line => {
|
||||
return log.filter(line => !!line).map(line => {
|
||||
return JSON.parse(line)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue