From ba570be9ff30896fd37748f6a9f766f7712bed67 Mon Sep 17 00:00:00 2001 From: zhl Date: Thu, 6 May 2021 18:48:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B8=B8=E6=88=8F=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/PuzzleMathRoom.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rooms/PuzzleMathRoom.ts b/src/rooms/PuzzleMathRoom.ts index 0811ced..53565e3 100644 --- a/src/rooms/PuzzleMathRoom.ts +++ b/src/rooms/PuzzleMathRoom.ts @@ -131,9 +131,15 @@ export class PuzzleMathRoom extends Room { /** * 游戏结束 */ - endGame() { - console.log(`[${this.roomId}] admin send end game cmd`) + endGame(options: any) { + console.log(`[${this.roomId}] admin send end game cmd: ${JSON.stringify(options)}`) this.dispatcher.dispatch(new EndGameCommand() ) + if (options.closeTime) { + let self = this + this.beginSchedule(options.closeTime, async function (){ + await self.disconnect() + }.bind(this), ClockNameConst.ROOM_LIFE_CLOCK) + } } updateScore(datas: any) {