修正重新开始无法正常工作的bug

This commit is contained in:
zhl 2020-12-11 21:41:07 +08:00
parent 735897848c
commit 8fe6eddfb7

View File

@ -39,7 +39,7 @@ export class GeneralRoom extends Room {
this.setState(cs);
this.battleMan.init(cs, this);
this.clock.start();
this.state.gameSate = 0;
this.state.gameState = GameStateConst.STATE_WAIT_JOIN;
this.beginSchedule(1, function (){
debugRoom('init main clock');
}, 'init')
@ -115,7 +115,8 @@ export class GeneralRoom extends Room {
// } catch (e) {
// this.state.players.delete(client.sessionId);
// }
if (this.state.gameSate === GameStateConst.STATE_GAME_OVER) {
//TODO: 检查重新开始后, gameState
if (this.state.gameState === GameStateConst.STATE_GAME_OVER) {
this.state.players.delete(client.id);
}
}