From 70123805e10a2350883e7f96cccea6e9ab9a1dbc Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 7 May 2019 18:23:12 +0900 Subject: [PATCH] Fix #4866 --- .../common/views/components/games/reversi/reversi.game.vue | 1 + src/server/api/stream/channels/games/reversi-game.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/app/common/views/components/games/reversi/reversi.game.vue b/src/client/app/common/views/components/games/reversi/reversi.game.vue index bd0401f785..315fb464b2 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.game.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.game.vue @@ -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 diff --git a/src/server/api/stream/channels/games/reversi-game.ts b/src/server/api/stream/channels/games/reversi-game.ts index 13e3f25e5b..e600179480 100644 --- a/src/server/api/stream/channels/games/reversi-game.ts +++ b/src/server/api/stream/channels/games/reversi-game.ts @@ -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)); } }