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
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<title>🧩 jigsaw.hyottoko.club</title>
|
<title>🧩 jigsaw.hyottoko.club</title>
|
||||||
<script type="module" crossorigin src="/assets/index.c6197c7d.js"></script>
|
<script type="module" crossorigin src="/assets/index.87048674.js"></script>
|
||||||
<link rel="modulepreload" href="/assets/vendor.684f7bc8.js">
|
<link rel="modulepreload" href="/assets/vendor.684f7bc8.js">
|
||||||
<link rel="stylesheet" href="/assets/index.8f0efd0f.css">
|
<link rel="stylesheet" href="/assets/index.8f0efd0f.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
|
||||||
|
|
@ -1173,6 +1173,12 @@ function handleInput$1(gameId, playerId, input, ts, onSnap) {
|
||||||
changePlayer(gameId, playerId, { d, ts });
|
changePlayer(gameId, playerId, { d, ts });
|
||||||
_playerChange();
|
_playerChange();
|
||||||
}
|
}
|
||||||
|
if (snapped && getSnapMode(gameId) === SnapMode.REAL) {
|
||||||
|
if (getFinishedPiecesCount(gameId) === getPieceCount(gameId)) {
|
||||||
|
changeData(gameId, { finished: ts });
|
||||||
|
_dataChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (snapped && onSnap) {
|
if (snapped && onSnap) {
|
||||||
onSnap(playerId);
|
onSnap(playerId);
|
||||||
}
|
}
|
||||||
|
|
@ -1309,7 +1315,7 @@ const get = (gameId, offset = 0) => {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const log = fs.readFileSync(file, 'utf-8').split("\n");
|
const log = fs.readFileSync(file, 'utf-8').split("\n");
|
||||||
return log.map(line => {
|
return log.filter(line => !!line).map(line => {
|
||||||
return JSON.parse(line);
|
return JSON.parse(line);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -848,6 +848,13 @@ function handleInput(
|
||||||
changePlayer(gameId, playerId, { d, ts })
|
changePlayer(gameId, playerId, { d, ts })
|
||||||
_playerChange()
|
_playerChange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (snapped && getSnapMode(gameId) === SnapMode.REAL) {
|
||||||
|
if (getFinishedPiecesCount(gameId) === getPieceCount(gameId)) {
|
||||||
|
changeData(gameId, { finished: ts })
|
||||||
|
_dataChange()
|
||||||
|
}
|
||||||
|
}
|
||||||
if (snapped && onSnap) {
|
if (snapped && onSnap) {
|
||||||
onSnap(playerId)
|
onSnap(playerId)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ const get = (
|
||||||
}
|
}
|
||||||
|
|
||||||
const log = fs.readFileSync(file, 'utf-8').split("\n")
|
const log = fs.readFileSync(file, 'utf-8').split("\n")
|
||||||
return log.map(line => {
|
return log.filter(line => !!line).map(line => {
|
||||||
return JSON.parse(line)
|
return JSON.parse(line)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue