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) {