修改游戏结束的逻辑
This commit is contained in:
parent
0a05ed9ba1
commit
ba570be9ff
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user