ground work for different users on server and players on client

This commit is contained in:
Jeena Paradies 2012-07-13 21:10:08 +02:00
parent e37d1eeb2e
commit 2cb401bbd3
9 changed files with 122 additions and 54 deletions

View file

@ -1,12 +1,12 @@
define(["Chuck/Processors/ServerProcessor"], function(ServerProcessor) {
function ServerGame(chanel) {
this.chanel = chanel;
this.processor = new ServerProcessor();
function ServerGame(channel) {
this.channel = channel;
this.serverProcessor = new ServerProcessor(this);
}
ServerGame.prototype.loadLevel = function(path) {
this.processor.loadLevel(path);
this.serverProcessor.loadLevel(path);
}
ServerGame.prototype.processGameCommand = function(command, options) {
@ -14,7 +14,15 @@ define(["Chuck/Processors/ServerProcessor"], function(ServerProcessor) {
}
ServerGame.prototype.destruct = function() {
this.processor.destruct();
this.serverProcessor.destruct();
}
ServerGame.prototype.createPlayerForUser = function(user) {
this.serverProcessor.createPlayerWithId(user.id);
}
ServerGame.prototype.updateClientsWorld = function(update_world) {
this.channel.sendCommandToAllUsers('gameCommand', update_world);
}
return ServerGame;