Stops sending gameCommands between beginRound and clientReady

Listen for beginRound control command
to set client to be unready again
so it can load its new level without getting
any gameCommands like worldUpdate
This commit is contained in:
logsol 2016-10-01 16:08:01 +02:00
parent 016c48ec3b
commit 8b8093b771
2 changed files with 10 additions and 1 deletions

View file

@ -61,6 +61,16 @@ function(Parent, Nc, ProtocolHelper, ProtocolParser) {
var recipient = this.id;
var data = ProtocolHelper.encodeCommand(command, options);
/**
* Listen for beginRound control command
* to set client to be unready again
* so it can load its new level without getting
* any gameCommands like worldUpdate
*/
if(command == "beginRound") {
this.isReady = false;
}
Nc.trigger(Nc.ns.channel.to.server.controlCommand.send, recipient, data);
};

View file

@ -191,7 +191,6 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
if(this.gameController) {
this.gameController.destroy();
delete this.gameController;
}
this.gameController = new GameController(options);