mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
altered define paths
This commit is contained in:
parent
ae09efa381
commit
ced41c3611
1 changed files with 10 additions and 10 deletions
20
app/Game/Client/Networker.js
Normal file → Executable file
20
app/Game/Client/Networker.js
Normal file → Executable file
|
|
@ -1,8 +1,8 @@
|
||||||
define(["Protocol/Helper", "Chuck/ClientGame"], function(ProtocolHelper, ClientGame) {
|
define(["Game/Core/Protocol/Helper", "Game/Client/GameController"], function(ProtocolHelper, GameController) {
|
||||||
|
|
||||||
function Networker(socketLink) {
|
function Networker(socketLink) {
|
||||||
this.socketLink = socketLink;
|
this.socketLink = socketLink;
|
||||||
this.clientGame = null;
|
this.GameController = null;
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
@ -36,8 +36,8 @@ define(["Protocol/Helper", "Chuck/ClientGame"], function(ProtocolHelper, ClientG
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.onDisconnect = function() {
|
Networker.prototype.onDisconnect = function() {
|
||||||
this.clientGame.destruct();
|
this.GameController.destruct();
|
||||||
this.clientGame = null;
|
this.GameController = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.join = function(channelName){
|
Networker.prototype.join = function(channelName){
|
||||||
|
|
@ -50,19 +50,19 @@ define(["Protocol/Helper", "Chuck/ClientGame"], function(ProtocolHelper, ClientG
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.onJoinSuccess = function(options) {
|
Networker.prototype.onJoinSuccess = function(options) {
|
||||||
this.clientGame = new ClientGame(this, options.id);
|
this.GameController = new GameController(this, options.id);
|
||||||
this.clientGame.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) {
|
||||||
for(var i = 0; i < options.userIds.length; i++) {
|
for(var i = 0; i < options.userIds.length; i++) {
|
||||||
this.clientGame.userJoined(options.userIds[i])
|
this.GameController.userJoined(options.userIds[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.onUserJoined = function(userId) {
|
Networker.prototype.onUserJoined = function(userId) {
|
||||||
this.clientGame.userJoined(userId);
|
this.GameController.userJoined(userId);
|
||||||
console.log("User " + userId + " joined");
|
console.log("User " + userId + " joined");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ define(["Protocol/Helper", "Chuck/ClientGame"], function(ProtocolHelper, ClientG
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.onUserLeft = function(userId) {
|
Networker.prototype.onUserLeft = function(userId) {
|
||||||
this.clientGame.userLeft(userId);
|
this.GameController.userLeft(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.processControlCommand = function(command, options) {
|
Networker.prototype.processControlCommand = function(command, options) {
|
||||||
|
|
@ -82,7 +82,7 @@ define(["Protocol/Helper", "Chuck/ClientGame"], function(ProtocolHelper, ClientG
|
||||||
|
|
||||||
case 'gameCommand':
|
case 'gameCommand':
|
||||||
for(var gameCommand in options) {
|
for(var gameCommand in options) {
|
||||||
this.clientGame.processGameCommand(gameCommand, options[gameCommand]);
|
this.GameController.processGameCommand(gameCommand, options[gameCommand]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue