mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
replaced all tabs with 4 spaces
This commit is contained in:
parent
5d11540c55
commit
26f3d22db7
30 changed files with 1017 additions and 1011 deletions
|
|
@ -34,14 +34,7 @@ function(ProtocolHelper, GameController) {
|
||||||
console.log('connected.')
|
console.log('connected.')
|
||||||
this.join('dungeon');
|
this.join('dungeon');
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
Networker.prototype.onMessage = function(message) {
|
|
||||||
var self = this;
|
|
||||||
ProtocolHelper.runCommands(message, function(command, options) {
|
|
||||||
self.processControlCommand(command, options);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
Networker.prototype.onDisconnect = function() {
|
Networker.prototype.onDisconnect = function() {
|
||||||
if(this.gameController) this.gameController.destruct();
|
if(this.gameController) this.gameController.destruct();
|
||||||
this.gameController = null;
|
this.gameController = null;
|
||||||
|
|
@ -52,14 +45,11 @@ function(ProtocolHelper, GameController) {
|
||||||
this.sendCommand('join', channelName);
|
this.sendCommand('join', channelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.sendCommand = function(command, options) {
|
|
||||||
var message = ProtocolHelper.encodeCommand(command, options);
|
|
||||||
this.socketLink.send(message);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
Networker.prototype.onJoinSuccess = function(options) {
|
Networker.prototype.onJoinSuccess = function(options) {
|
||||||
this.gameController = new GameController(options.id);
|
this.gameController = new GameController(options.id);
|
||||||
this.gameController.loadLevel("default.json")
|
this.gameController.loadLevel("default.json");
|
||||||
|
/*
|
||||||
console.log("Joined " + options.channelName);
|
console.log("Joined " + options.channelName);
|
||||||
|
|
||||||
if (options.userIds && options.userIds.length > 0) {
|
if (options.userIds && options.userIds.length > 0) {
|
||||||
|
|
@ -67,6 +57,22 @@ function(ProtocolHelper, GameController) {
|
||||||
this.gameController.userJoined(options.userIds[i])
|
this.gameController.userJoined(options.userIds[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
Networker.prototype.sendCommand = function(command, options) {
|
||||||
|
var message = ProtocolHelper.encodeCommand(command, options);
|
||||||
|
this.socketLink.send(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Networker.prototype.onMessage = function(message) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
ProtocolHelper.runCommands(message, function(command, options) {
|
||||||
|
self.processControlCommand(command, options);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.onUserJoined = function(userId) {
|
Networker.prototype.onUserJoined = function(userId) {
|
||||||
|
|
|
||||||
0
app/Game/Core/Control/InputController.js
Normal file → Executable file
0
app/Game/Core/Control/InputController.js
Normal file → Executable file
0
app/Game/Core/Player.js
Normal file → Executable file
0
app/Game/Core/Player.js
Normal file → Executable file
0
app/Game/Core/Protocol/Helper.js
Normal file → Executable file
0
app/Game/Core/Protocol/Helper.js
Normal file → Executable file
0
app/Game/Core/Protocol/Parser.js
Normal file → Executable file
0
app/Game/Core/Protocol/Parser.js
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue