fiusing notificationCenter for sendCommandToAllUsers for testing, seems to work

This commit is contained in:
Jeena Paradies 2012-07-21 01:29:58 +02:00
parent 4ac86c69b4
commit 8cf8f057bb
4 changed files with 20 additions and 8 deletions

View file

@ -14,10 +14,10 @@ define(requires, function(PhysicsEngine, Settings, Player, Box2D, Level, InputCo
this.serverGame = serverGame;
this.players = {};
this.init();
};
}
ServerProcessor.prototype.init = function() {
this.physicsEngine = new PhysicsEngine();
this.physicsEngine = this.factory.new(PhysicsEngine);
this.update();
this.updateWorld();
@ -95,7 +95,8 @@ define(requires, function(PhysicsEngine, Settings, Player, Box2D, Level, InputCo
} while (body = body.GetNext());
if(isUpdateNeeded) {
this.serverGame.updateClientsWorld(update);
//this.serverGame.updateClientsWorld(update);
this.notificationCenter.trigger("sendCommandToAllUsers", ['gameCommand', {worldUpdate:update}]);
}
setTimeout(this.updateWorld.bind(this), Settings.WORLD_UPDATE_BROADCAST_INTERVAL);