mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
ground work for different users on server and players on client
This commit is contained in:
parent
e37d1eeb2e
commit
2cb401bbd3
9 changed files with 122 additions and 54 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue