mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
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:
parent
016c48ec3b
commit
8b8093b771
2 changed files with 10 additions and 1 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue