修改游戏结束的逻辑

This commit is contained in:
zhl 2021-05-06 18:48:50 +08:00
parent 0a05ed9ba1
commit ba570be9ff

View File

@ -131,9 +131,15 @@ export class PuzzleMathRoom extends Room {
/** /**
* *
*/ */
endGame() { endGame(options: any) {
console.log(`[${this.roomId}] admin send end game cmd`) console.log(`[${this.roomId}] admin send end game cmd: ${JSON.stringify(options)}`)
this.dispatcher.dispatch(new EndGameCommand() ) 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) { updateScore(datas: any) {