mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 22:17:30 -07:00
Fix #4866
This commit is contained in:
parent
0a3b4e364a
commit
7a181b3c9c
2 changed files with 3 additions and 2 deletions
|
@ -200,6 +200,7 @@ export default Vue.extend({
|
|||
// 通信を取りこぼしてもいいように定期的にポーリングさせる
|
||||
if (this.game.isStarted && !this.game.isEnded) {
|
||||
this.pollingClock = setInterval(() => {
|
||||
if (this.game.isEnded) return;
|
||||
const crc32 = CRC32.str(this.logs.map(x => x.pos.toString()).join(''));
|
||||
this.connection.send('check', {
|
||||
crc32: crc32
|
||||
|
|
|
@ -302,13 +302,13 @@ export default class extends Channel {
|
|||
}
|
||||
|
||||
@autobind
|
||||
private async check(crc32: string) {
|
||||
private async check(crc32: string | number) {
|
||||
const game = await ReversiGames.findOne(this.gameId!);
|
||||
if (game == null) throw new Error('game not found');
|
||||
|
||||
if (!game.isStarted) return;
|
||||
|
||||
if (crc32 !== game.crc32) {
|
||||
if (crc32.toString() !== game.crc32) {
|
||||
this.send('rescue', await ReversiGames.pack(game, this.user));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue