mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
33 lines
No EOL
947 B
JavaScript
33 lines
No EOL
947 B
JavaScript
define(["Chuck/Processors/ServerProcessor"], function(ServerProcessor) {
|
|
|
|
function ServerGame(channel) {
|
|
this.channel = channel;
|
|
this.serverProcessor = this.factory.new(ServerProcessor, this);
|
|
}
|
|
|
|
ServerGame.prototype.loadLevel = function(path) {
|
|
this.serverProcessor.loadLevel(path);
|
|
}
|
|
|
|
ServerGame.prototype.progressGameCommandFromUser = function(command, options, user) {
|
|
this.serverProcessor.progressGameCommandFromId(command, options, user.id);
|
|
}
|
|
|
|
ServerGame.prototype.destruct = function() {
|
|
this.serverProcessor.destruct();
|
|
}
|
|
|
|
ServerGame.prototype.createPlayerForUser = function(user) {
|
|
this.serverProcessor.createPlayerWithId(user.id);
|
|
}
|
|
|
|
ServerGame.prototype.userIdLeft = function(userId) {
|
|
this.serverProcessor.userIdLeft(userId);
|
|
};
|
|
|
|
ServerGame.prototype.updateClientsWorld = function(update_world) {
|
|
this.channel.sendCommandToAllUsers('gameCommand', {worldUpdate: update_world});
|
|
}
|
|
|
|
return ServerGame;
|
|
}); |