Makes singleton variable name of NotificationCenter lowercase

When we require a singleton, its instance name should be named
by lowercase, since it is not a class.

Relates to #128
This commit is contained in:
logsol 2016-10-10 22:11:55 +02:00
parent ffc55a204a
commit 3cb2e39a18
57 changed files with 262 additions and 262 deletions

View file

@ -7,7 +7,7 @@
"Game/Config/Settings"
],
function (GameController, Nc, User, ProtocolHelper, Options, Settings) {
function (GameController, nc, User, ProtocolHelper, Options, Settings) {
"use strict";
@ -26,14 +26,14 @@
});
// Notification Center
Nc.on(Nc.ns.channel.events.round.end, this.onEndRound, this);
Nc.on(Nc.ns.channel.events.controlCommand.channel, function (message) {
nc.on(nc.ns.channel.events.round.end, this.onEndRound, this);
nc.on(nc.ns.channel.events.controlCommand.channel, function (message) {
ProtocolHelper.applyCommand(message.data, self);
});
Nc.on(Nc.ns.channel.to.client.gameCommand.broadcast, this.broadcastGameCommand, this);
Nc.on(Nc.ns.channel.to.client.controlCommand.broadcast, this.broadcastControlCommand, this);
//Nc.on(Nc.ns.channel.to.client.gameCommand.broadcastExcept, this.broadcastGameCommandExcept, this);
//Nc.on(Nc.ns.channel.to.client.controlCommand.broadcastExcept, this.broadcastControlCommandExcept, this);
nc.on(nc.ns.channel.to.client.gameCommand.broadcast, this.broadcastGameCommand, this);
nc.on(nc.ns.channel.to.client.controlCommand.broadcast, this.broadcastControlCommand, this);
//nc.on(nc.ns.channel.to.client.gameCommand.broadcastExcept, this.broadcastGameCommandExcept, this);
//nc.on(nc.ns.channel.to.client.controlCommand.broadcastExcept, this.broadcastControlCommandExcept, this);
this.beginRound();
@ -103,10 +103,10 @@
};
if(!this.gameController.level || !this.gameController.level.isLoaded) {
var token = Nc.on(Nc.ns.core.game.events.level.loaded, function() {
var token = nc.on(nc.ns.core.game.events.level.loaded, function() {
self.sendJoinSuccess(options);
self.users[options.id].sendControlCommand("beginRound", clientGameControllerOptions);
Nc.off(token);
nc.off(token);
});
} else {
this.sendJoinSuccess(options);
@ -135,16 +135,16 @@
levelUid: levelUid
};
//Nc.trigger("user/" + user.id + "/joinSuccess", options);
//nc.trigger("user/" + user.id + "/joinSuccess", options);
user.sendControlCommand("joinSuccess", options);
Nc.trigger(Nc.ns.channel.events.user.joined, user);
nc.trigger(nc.ns.channel.events.user.joined, user);
this.broadcastControlCommandExcept("userJoined", user.options, user);
};
Channel.prototype.onReleaseUser = function (userId) {
var self = this;
Nc.trigger(Nc.ns.channel.events.user.left, userId);
nc.trigger(nc.ns.channel.events.user.left, userId);
delete this.users[userId];
this.broadcastControlCommand("userLeft", userId);

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function(Parent, Nc, Parser, Settings) {
function(Parent, nc, Parser, Settings) {
"use strict";
@ -71,7 +71,7 @@ function(Parent, Nc, Parser, Settings) {
lv: body.GetLinearVelocity()
};
Nc.trigger(Nc.ns.channel.to.client.user.gameCommand.send + this.player.id, "positionStateReset", options);
nc.trigger(nc.ns.channel.to.client.user.gameCommand.send + this.player.id, "positionStateReset", options);
}
};

View file

@ -11,7 +11,7 @@ define([
"Game/Channel/GameObjects/Items/RubeDoll"
],
function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RubeDoll) {
function (Parent, PhysicsEngine, Settings, requestAnimFrame, nc, Box2D, Player, GameObject, Doll, RubeDoll) {
"use strict";
@ -25,12 +25,12 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player,
Parent.call(this, options);
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.channel.events.user.joined, this.onUserJoined, this),
Nc.on(Nc.ns.channel.events.user.left, this.onUserLeft, this),
Nc.on(Nc.ns.channel.events.user.level.reset, this.onResetLevel, this),
Nc.on(Nc.ns.channel.events.user.client.ready, this.onClientReady, this),
Nc.on(Nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this),
Nc.on(Nc.ns.channel.events.game.player.killed, this.onPlayerKilled, this),
nc.on(nc.ns.channel.events.user.joined, this.onUserJoined, this),
nc.on(nc.ns.channel.events.user.left, this.onUserLeft, this),
nc.on(nc.ns.channel.events.user.level.reset, this.onResetLevel, this),
nc.on(nc.ns.channel.events.user.client.ready, this.onClientReady, this),
nc.on(nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this),
nc.on(nc.ns.channel.events.game.player.killed, this.onPlayerKilled, this),
]);
console.checkpoint('starting game controller for channel (' + options.channelName + ')');
@ -65,7 +65,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player,
};
GameController.prototype.clearItemsOfPlayerFingerPrints = function(player) {
Nc.trigger(Nc.ns.channel.events.game.player.clearFingerPrints, player);
nc.trigger(nc.ns.channel.events.game.player.clearFingerPrints, player);
};
GameController.prototype.createPlayer = function(user) {
@ -79,7 +79,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player,
GameController.prototype.onPlayerKilled = function(player, killedByPlayer) {
if(killedByPlayer.stats.score >= this.options.scoreLimit) {
Nc.trigger(Nc.ns.channel.events.round.end);
nc.trigger(nc.ns.channel.events.round.end);
} else {
this.spawnPlayer(player, Settings.RESPAWN_TIME);
}
@ -102,7 +102,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player,
y: spawnPoint.y
};
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "spawnPlayer", options);
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "spawnPlayer", options);
var i = self.spawnTimeouts.indexOf(spawnTimeout);
self.spawnTimeouts.splice(i, 1);
@ -117,7 +117,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player,
var update = this.getWorldUpdateObject(false);
if(Object.getOwnPropertyNames(update).length > 0) {
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "worldUpdate", update);
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "worldUpdate", update);
}
this.worldUpdateTimeout = setTimeout(this.updateWorld.bind(this), Settings.NETWORK_UPDATE_INTERVAL);
@ -232,7 +232,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player,
userId: userId
};
Nc.trigger(Nc.ns.channel.to.client.user.gameCommand.send + userId, "clientReadyResponse", options);
nc.trigger(nc.ns.channel.to.client.user.gameCommand.send + userId, "clientReadyResponse", options);
this.spawnPlayer(player, 0);
};
@ -255,7 +255,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player,
console.log('OH NO!!! ON RESET LEVEL IS CALLED AND RESPAWNES PLAYERS');
Parent.prototype.onResetLevel.call(this);
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "resetLevel", true);
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "resetLevel", true);
for (var key in this.players) {
this.spawnPlayer(this.players[key]);
}

View file

@ -6,7 +6,7 @@ define([
"Lib/Utilities/Assert"
],
function (Parent, Item, Box2D, Nc, Assert) {
function (Parent, Item, Box2D, nc, Assert) {
"use strict";
@ -80,7 +80,7 @@ function (Parent, Item, Box2D, Nc, Assert) {
self.player.addDamage(damage, lastMovedPlayer, item);
};
Nc.trigger(Nc.ns.channel.engine.worldQueue.add, callback);
nc.trigger(nc.ns.channel.engine.worldQueue.add, callback);
}
}

View file

@ -3,7 +3,7 @@ define([
"Lib/Utilities/NotificationCenter",
],
function (Parent, Nc) {
function (Parent, nc) {
"use strict";
@ -13,7 +13,7 @@ function (Parent, Nc) {
this.lastMoved = null;
this.ncTokens = (this.ncTokens || []).concat([
Nc.on(Nc.ns.channel.events.game.player.clearFingerPrints, this.clearOfPlayerFingerPrints, this)
nc.on(nc.ns.channel.events.game.player.clearFingerPrints, this.clearOfPlayerFingerPrints, this)
]);
}

View file

@ -4,7 +4,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, Settings, Nc) {
function (Parent, Settings, nc) {
"use strict";
@ -35,7 +35,7 @@ function (Parent, Settings, Nc) {
var self = this;
this.scheduledForDestruction = true;
this.destructionTimeout = setTimeout(function() {
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', {
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', {
type: 'animated',
uid: self.uid
});

View file

@ -4,7 +4,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, Settings, Nc) {
function (Parent, Settings, nc) {
"use strict";
@ -35,7 +35,7 @@ function (Parent, Settings, Nc) {
var self = this;
this.scheduledForDestruction = true;
this.destructionTimeout = setTimeout(function() {
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', {
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', {
type: 'animated',
uid: self.uid
});

View file

@ -5,7 +5,7 @@ define([
"fs"
],
function (Nc, Channel, Settings, fs) {
function (nc, Channel, Settings, fs) {
"use strict";
@ -14,7 +14,7 @@ function (Nc, Channel, Settings, fs) {
this.process = process;
this.recordingFileName = null;
Nc.on(Nc.ns.channel.to.server.controlCommand.send, this.send, this);
nc.on(nc.ns.channel.to.server.controlCommand.send, this.send, this);
process.on("message", this.onProcessMessage.bind(this));
}
@ -82,10 +82,10 @@ function (Nc, Channel, Settings, fs) {
PipeToServer.prototype.onMessage = function (message) {
switch(message.recipient) {
case "channel":
Nc.trigger(Nc.ns.channel.events.controlCommand.channel, message);
nc.trigger(nc.ns.channel.events.controlCommand.channel, message);
break;
default:
Nc.trigger(Nc.ns.channel.events.controlCommand.user + message.recipient, message);
nc.trigger(nc.ns.channel.events.controlCommand.user + message.recipient, message);
break;
}

View file

@ -4,7 +4,7 @@ define([
"Game/Channel/Control/PlayerController"
],
function (Parent, Nc, PlayerController) {
function (Parent, nc, PlayerController) {
"use strict";
@ -44,7 +44,7 @@ function (Parent, Nc, PlayerController) {
this.throw(options, item);
options.action = "throw";
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "handActionResponse", options);
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "handActionResponse", options);
}
} else {
// grab
@ -52,7 +52,7 @@ function (Parent, Nc, PlayerController) {
this.grab(item);
options.action = "grab";
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "handActionResponse", options);
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "handActionResponse", options);
}
}
};
@ -93,14 +93,14 @@ function (Parent, Nc, PlayerController) {
var ragDollId = this.stats.deaths;
Parent.prototype.kill.call(this, killedByPlayer, ragDollId);
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "playerKill", {
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "playerKill", {
playerId: this.id,
killedByPlayerId: killedByPlayer.id,
ragDollId: ragDollId,
item: byItem ? byItem.options.name : "Suicide"
});
Nc.trigger(Nc.ns.channel.events.game.player.killed, this, killedByPlayer); // sends endround
nc.trigger(nc.ns.channel.events.game.player.killed, this, killedByPlayer); // sends endround
if(this.ragDoll) {
this.ragDoll.delayedDestroy();
@ -112,13 +112,13 @@ function (Parent, Nc, PlayerController) {
};
Player.prototype.broadcastStats = function(enemy) {
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "updateStats", {
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "updateStats", {
playerId: this.id,
stats: this.stats
});
if(enemy && enemy != this) {
Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, "updateStats", {
nc.trigger(nc.ns.channel.to.client.gameCommand.broadcast, "updateStats", {
playerId: enemy.id,
stats: enemy.stats
});

View file

@ -5,7 +5,7 @@ define([
"Lib/Utilities/Protocol/Parser",
],
function(Parent, Nc, ProtocolHelper, ProtocolParser) {
function(Parent, nc, ProtocolHelper, ProtocolParser) {
function User(id, options) {
Parent.call(this, id, options);
@ -14,15 +14,15 @@ function(Parent, Nc, ProtocolHelper, ProtocolParser) {
this.isReady = false;
var self = this;
Nc.on(Nc.ns.channel.to.client.user.controlCommand.joinSuccess + this.id, function(options) {
nc.on(nc.ns.channel.to.client.user.controlCommand.joinSuccess + this.id, function(options) {
self.sendControlCommand("joinSuccess", options);
});
Nc.on(Nc.ns.channel.events.controlCommand.user + this.id, function(message) {
nc.on(nc.ns.channel.events.controlCommand.user + this.id, function(message) {
ProtocolHelper.applyCommand(message.data, self);
});
Nc.on(Nc.ns.channel.to.client.user.gameCommand.send + this.id, function(command, options) {
nc.on(nc.ns.channel.to.client.user.gameCommand.send + this.id, function(command, options) {
self.sendGameCommand(command, options);
});
@ -44,10 +44,10 @@ function(Parent, Nc, ProtocolHelper, ProtocolParser) {
} // FIXME: move this to Protocol helper as a function
if(command.hasOwnProperty("resetLevel")) {
Nc.trigger(Nc.ns.channel.events.user.level.reset, this.id);
nc.trigger(nc.ns.channel.events.user.level.reset, this.id);
} else if(command.hasOwnProperty("clientReady")) {
this.isReady = true;
Nc.trigger(Nc.ns.channel.events.user.client.ready, this.id);
nc.trigger(nc.ns.channel.events.user.client.ready, this.id);
} else {
this.player.playerController.applyCommand(command);
}
@ -71,7 +71,7 @@ function(Parent, Nc, ProtocolHelper, ProtocolParser) {
this.isReady = false;
}
Nc.trigger(Nc.ns.channel.to.server.controlCommand.send, recipient, data);
nc.trigger(nc.ns.channel.to.server.controlCommand.send, recipient, data);
};
User.prototype.sendGameCommand = function(command, options) {

View file

@ -2,7 +2,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Nc) {
function (nc) {
function Input(playerController) {
this.playerController = playerController;

View file

@ -6,7 +6,7 @@ define([
"Game/Client/PointerLockManager"
],
function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
function (Parent, nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
"use strict";
@ -29,85 +29,85 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
PlayerController.prototype.moveLeft = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.moveLeft.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveLeft');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'moveLeft');
}
PlayerController.prototype.moveRight = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.moveRight.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveRight');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'moveRight');
}
// always allow to stop, to prevent endless running
PlayerController.prototype.stop = function () {
Parent.prototype.stop.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'stop');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'stop');
}
PlayerController.prototype.jump = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.jump.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jump');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'jump');
}
// always allow to stop.
PlayerController.prototype.jumpStop = function () {
Parent.prototype.jumpStop.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jumpStop');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'jumpStop');
}
PlayerController.prototype.setXY = function(x, y) {
if (!this.isPlayerInputAllowed()) return;
var options = {x:x, y:y};
Parent.prototype.lookAt.call(this, options);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'lookAt', options);
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'lookAt', options);
};
PlayerController.prototype.suicide = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "suicide");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "suicide");
};
PlayerController.prototype.handActionRequest = function(options) {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "handActionRequest", options);
nc.trigger(nc.ns.client.to.server.gameCommand.send, "handActionRequest", options);
};
PlayerController.prototype.showInfo = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.gameStats.toggle, true);
nc.trigger(nc.ns.client.game.gameStats.toggle, true);
};
PlayerController.prototype.hideInfo = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.gameStats.toggle, false);
nc.trigger(nc.ns.client.game.gameStats.toggle, false);
};
PlayerController.prototype.zoomIn = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomIn, true);
nc.trigger(nc.ns.client.game.zoomIn, true);
};
PlayerController.prototype.zoomOut = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomOut, false);
nc.trigger(nc.ns.client.game.zoomOut, false);
};
PlayerController.prototype.zoomReset = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomReset, false);
nc.trigger(nc.ns.client.game.zoomReset, false);
};
PlayerController.prototype.activateModifier = function() {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.activateModifier.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "activateModifier");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "activateModifier");
};
PlayerController.prototype.deactivateModifier = function() {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.deactivateModifier.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "deactivateModifier");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "deactivateModifier");
};
/*

View file

@ -2,7 +2,7 @@ define([
"Lib/Utilities/NotificationCenter",
],
function (Nc) {
function (nc) {
var MAX_LENGTH = 200;
var MIN_LENGTH = 5;
@ -42,7 +42,7 @@ function (Nc) {
}
var i = points.length - 1;
Nc.trigger(Nc.ns.client.view.swiper.swipe, points[i].x, points[i].y);
nc.trigger(nc.ns.client.view.swiper.swipe, points[i].x, points[i].y);
}
Swiper.prototype.updateLengthSum = function(currentLength) {
@ -135,7 +135,7 @@ function (Nc) {
var sumx = 0;
var sumy = 0;
Nc.trigger(Nc.ns.client.view.swiper.end);
nc.trigger(nc.ns.client.view.swiper.end);
for(var i=0, count = this.points.length; i < count; i++) {
var p = this.points[i];
@ -166,7 +166,7 @@ function (Nc) {
Swiper.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -18,7 +18,7 @@ define([
"Lib/Utilities/Exception"
],
function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, requestAnimFrame, Settings, GameObject, Doll, domController, ProtocolHelper, Me, AudioPlayer, PointerLockManager, Assert, Exception) {
function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, nc, requestAnimFrame, Settings, GameObject, Doll, domController, ProtocolHelper, Me, AudioPlayer, PointerLockManager, Assert, Exception) {
"use strict";
@ -33,7 +33,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
Parent.call(this, options);
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.game.gameStats.toggle, this.toggleGameStats, this)
nc.on(nc.ns.client.game.gameStats.toggle, this.toggleGameStats, this)
]);
}
@ -55,7 +55,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
this.mePositionStateOverride();
}
Nc.trigger(Nc.ns.client.game.events.render);
nc.trigger(nc.ns.client.game.events.render);
this.view.render();
domController.fpsStep();
@ -63,8 +63,8 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
GameController.prototype.mePositionStateOverride = function() {
if(this.me.isPositionStateOverrideNeeded()) {
Nc.trigger(
Nc.ns.client.to.server.gameCommand.send,
nc.trigger(
nc.ns.client.to.server.gameCommand.send,
"mePositionStateOverride",
this.me.getPositionStateOverride()
);
@ -214,7 +214,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
return 0;
});
Nc.trigger(Nc.ns.client.view.gameStats.update, sortedPlayers);
nc.trigger(nc.ns.client.view.gameStats.update, sortedPlayers);
};
GameController.prototype.onPlayerKill = function(options) {
@ -222,7 +222,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
var killedByPlayer = this.players[options.killedByPlayerId];
player.kill(killedByPlayer, options.ragDollId);
Nc.trigger(Nc.ns.client.view.gameStats.kill, {
nc.trigger(nc.ns.client.view.gameStats.kill, {
victim: {
name: player.user.options.nickname,
isMe: player === this.me
@ -248,7 +248,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
};
GameController.prototype.toggleGameStats = function(show) {
Nc.trigger(Nc.ns.client.view.gameStats.toggle, show);
nc.trigger(nc.ns.client.view.gameStats.toggle, show);
};
GameController.prototype.beginRound = function() {

View file

@ -7,7 +7,7 @@ define([
"Game/Client/View/Abstract/Layer",
],
function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
function (Parent, Settings, nc, Exception, ColorConverter, Layer) {
"use strict";
@ -50,14 +50,14 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
if(!state) throw new Exception("action state is undefined");
if(this.animatedMeshes[this.actionState]) {
Nc.trigger(
Nc.ns.client.view.mesh.update,
nc.trigger(
nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshesContainer.withArms[this.actionState],
{ visible: false }
);
Nc.trigger(
Nc.ns.client.view.mesh.update,
nc.trigger(
nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshesContainer.withoutArms[this.actionState],
{ visible: false }
@ -66,8 +66,8 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
Parent.prototype.setActionState.call(this, state);
Nc.trigger(
Nc.ns.client.view.mesh.update,
nc.trigger(
nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshes[this.actionState],
{
@ -82,7 +82,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var self = this;
var setShirtColor = function (mesh) {
Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, 'colorRangeReplace', {
nc.trigger(nc.ns.client.view.mesh.addFilter, self.layerId, mesh, 'colorRangeReplace', {
minColor: 0x3b4a31,
maxColor: 0x657f54,
newColor: self.primaryColor,
@ -131,12 +131,12 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var callback = function(mesh) {
self.animatedMeshesContainer[arm][key] = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
setShirtColor(mesh);
};
Nc.trigger(Nc.ns.client.view.animatedMesh.create, this.layerId, texturePaths, callback, {
nc.trigger(nc.ns.client.view.animatedMesh.create, this.layerId, texturePaths, callback, {
visible: false,
pivot: {
x: 0,
@ -159,9 +159,9 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var texturePath = Settings.GRAPHICS_PATH + "Characters/Chuck/head.png";
var callback = function (mesh) {
self.headMesh = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
pivot: {
x: 5,
y: 12
@ -179,10 +179,10 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
texturePath = Settings.GRAPHICS_PATH + "Characters/Chuck/holdingArm.png";
var callback = function (mesh) {
self.holdingArmMesh = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
setShirtColor(mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
visible: false,
pivot: {
//x: 35/2 * 4,
@ -206,7 +206,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
if(oldLookDirection != this.lookDirection) {
for(var key in this.animatedMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshes[key],
{
@ -215,7 +215,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
);
}
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.holdingArmMesh,
{
@ -226,7 +226,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var angle = Math.atan2(this.lookAtXY.x, this.lookAtXY.y) / 2 - 0.7855 * this.lookDirection; // 0.7855 = 45°
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.headMesh,
{
@ -240,22 +240,22 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
Parent.prototype.grab.call(this, item);
this.animatedMeshes = this.animatedMeshesContainer.withoutArms;
this.setActionState(this.actionState, true);
Nc.trigger(Nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: true });
nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: true });
};
Doll.prototype.throw = function(item, options) {
Parent.prototype.throw.call(this, item, options);
this.animatedMeshes = this.animatedMeshesContainer.withArms;
this.setActionState(this.actionState, true);
Nc.trigger(Nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: false });
nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: false });
};
Doll.prototype.destroy = function () {
for (var key in this.animatedMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.animatedMeshes[key]);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.animatedMeshes[key]);
}
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.headMesh);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.headMesh);
Parent.prototype.destroy.call(this);
}
@ -272,7 +272,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var factor = stepLength / 30;
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshes[this.actionState],
{
@ -283,7 +283,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
}
);
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.headMesh,
{
@ -292,7 +292,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
}
)
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.holdingArmMesh,
{

View file

@ -4,7 +4,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, Exception, Nc) {
function (Parent, Exception, nc) {
"use strict";

View file

@ -5,7 +5,7 @@ define([
"Game/Client/View/Abstract/Layer"
],
function (Parent, Settings, Nc, Layer) {
function (Parent, Settings, nc, Layer) {
"use strict";
@ -14,7 +14,7 @@ function (Parent, Settings, Nc, Layer) {
Parent.call(this, physicsEngine, uid, options);
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.game.events.render, this.render, this)
nc.on(nc.ns.client.game.events.render, this.render, this)
]);
}
@ -30,10 +30,10 @@ function (Parent, Settings, Nc, Layer) {
var callback = function(mesh) {
self.mesh = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
this.layerId,
texturePath,
callback,
@ -49,13 +49,13 @@ function (Parent, Settings, Nc, Layer) {
};
Item.prototype.destroy = function() {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
Parent.prototype.destroy.call(this);
};
Item.prototype.render = function() {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{
@ -72,7 +72,7 @@ function (Parent, Settings, Nc, Layer) {
Parent.prototype.flip.call(this, direction);
if(oldFlipDirection != direction) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{

View file

@ -6,7 +6,7 @@ define([
"Game/Client/View/Abstract/Layer"
],
function (Parent, CoreItem, Settings, Nc, Layer) {
function (Parent, CoreItem, Settings, nc, Layer) {
"use strict";
@ -40,10 +40,10 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
self.limbMeshes[name] = mesh;
}
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
this.layerId,
texturePath + name + ".png",
callback,
@ -64,7 +64,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
if(this.limbs) {
for(var name in this.limbMeshes) {
if(this.limbs[name]) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.limbMeshes[name],
{
@ -85,7 +85,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
CoreItem.prototype.flip.call(this, direction);
if(oldFlipDirection != direction) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{
@ -94,7 +94,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
);
for (var name in this.limbMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.limbMeshes[name],
{
@ -108,7 +108,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
RagDoll.prototype.destroy = function() {
for (var name in this.limbMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]);
};
Parent.prototype.destroy.call(this);

View file

@ -5,7 +5,7 @@ define([
"Lib/Utilities/NotificationCenter",
],
function (Parent, Layer, Settings, Nc) {
function (Parent, Layer, Settings, nc) {
"use strict";
@ -131,10 +131,10 @@ function (Parent, Layer, Settings, Nc) {
self.limbMeshes[name] = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
// setting shirt color
Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", {
nc.trigger(nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", {
minColor: 0x3b4a31,
maxColor: 0x6d855d,
newColor: self.primaryColor,
@ -142,7 +142,7 @@ function (Parent, Layer, Settings, Nc) {
});
};
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
this.layerId,
texturePath + name + ".png",
callback,
@ -160,7 +160,7 @@ function (Parent, Layer, Settings, Nc) {
RubeDoll.prototype.destroy = function() {
for (var name in this.limbMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]);
};
Parent.prototype.destroy.call(this);
@ -169,7 +169,7 @@ function (Parent, Layer, Settings, Nc) {
RubeDoll.prototype.render = function() {
//Parent.prototype.render.call(this);
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{
@ -182,7 +182,7 @@ function (Parent, Layer, Settings, Nc) {
if(this.limbs) {
for(var name in this.limbMeshes) {
if(this.limbs[name]) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.limbMeshes[name],
{
@ -205,29 +205,29 @@ function (Parent, Layer, Settings, Nc) {
this.lastFlipDirection = direction;
Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes,
nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes,
this.layerId,
this.limbMeshes["lowerRightLeg"],
this.limbMeshes["lowerLeftLeg"]
);
Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes,
nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes,
this.layerId,
this.limbMeshes["upperRightLeg"],
this.limbMeshes["upperLeftLeg"]
);
Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes,
nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes,
this.layerId,
this.limbMeshes["lowerRightArm"],
this.limbMeshes["lowerLeftArm"]
);
Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes,
nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes,
this.layerId,
this.limbMeshes["upperRightArm"],
this.limbMeshes["upperLeftArm"]
);
// swap short images
Nc.trigger(Nc.ns.client.view.mesh.swapMeshes,
nc.trigger(nc.ns.client.view.mesh.swapMeshes,
this.layerId,
this.limbMeshes["upperRightLeg"],
this.limbMeshes["upperLeftLeg"]
@ -238,7 +238,7 @@ function (Parent, Layer, Settings, Nc) {
if(this.limbs) {
for(var name in this.limbMeshes) {
if(this.limbs[name]) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.limbMeshes[name],
{

View file

@ -5,7 +5,7 @@ define([
"Game/Client/View/Abstract/Layer"
],
function (Parent, Settings, Nc, Layer) {
function (Parent, Settings, nc, Layer) {
"use strict";
@ -31,10 +31,10 @@ function (Parent, Settings, Nc, Layer) {
var callback = function(mesh) {
self.mesh = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
this.layerId,
texturePath,
callback,
@ -50,13 +50,13 @@ function (Parent, Settings, Nc, Layer) {
};
Tile.prototype.destroy = function() {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
Parent.prototype.destroy.call(this);
};
Tile.prototype.render = function() {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{

View file

@ -6,7 +6,7 @@ define([
"Game/Client/View/Abstract/Layer"
],
function (Parent, Settings, Nc, PIXI, AbstractLayer) {
function (Parent, Settings, nc, PIXI, AbstractLayer) {
"use strict";
@ -46,7 +46,7 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
loader.onComplete = function() { callback(levelData); };
loader.onProgress = function() {
var progress = parseInt(100 / numPaths * ++count, 10) + 1;
Nc.trigger(Nc.ns.client.view.preloadBar.update, progress);
nc.trigger(nc.ns.client.view.preloadBar.update, progress);
}
loader.load();
};
@ -116,8 +116,8 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
if (options.properties && options.properties.parallaxSpeed) {
parallaxSpeed = parseFloat(options.properties.parallaxSpeed);
}
Nc.trigger(
Nc.ns.client.view.layer.createAndInsert,
nc.trigger(
nc.ns.client.view.layer.createAndInsert,
options.layerId,
{
parallaxSpeed: parallaxSpeed,

View file

@ -4,7 +4,7 @@ define([
"Lib/Utilities/NotificationCenter",
],
function (Parent, Settings, Nc) {
function (Parent, Settings, nc) {
"use strict";
@ -22,7 +22,7 @@ function (Parent, Settings, Nc) {
height: tilesLayerData.height * Settings.TILE_SIZE
};
Nc.trigger(Nc.ns.client.view.layer.levelSizeUpdate, this.levelSize);
nc.trigger(nc.ns.client.view.layer.levelSizeUpdate, this.levelSize);
Parent.prototype.setup.call(this, levelData);
};
@ -78,8 +78,8 @@ function (Parent, Settings, Nc) {
var texturePath = Settings.MAPS_PATH + options.image;
var callback = function(mesh) {
Nc.trigger(Nc.ns.client.view.mesh.add, options.layerId, mesh);
Nc.trigger(Nc.ns.client.view.mesh.update, options.layerId, mesh, {
nc.trigger(nc.ns.client.view.mesh.add, options.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.update, options.layerId, mesh, {
x: 0,//self.levelData.width * Settings.TILE_SIZE / 2,
y: 0,//self.levelData.height * Settings.TILE_SIZE / 2,
pivot: {
@ -91,7 +91,7 @@ function (Parent, Settings, Nc) {
});
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
options.layerId,
texturePath,
callback,
@ -123,10 +123,10 @@ function (Parent, Settings, Nc) {
var tileType = parts[parts.length - 1].split(".")[0].split("")
var callback = function(mesh) {
Nc.trigger(Nc.ns.client.view.mesh.add, options.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, options.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
options.layerId,
Settings.MAPS_PATH + imagePath,
callback,

View file

@ -6,7 +6,7 @@ define([
"Game/Client/Control/PlayerController",
],
function (Parent, Settings, Nc, Assert, PlayerController) {
function (Parent, Settings, nc, Assert, PlayerController) {
"use strict";
@ -108,7 +108,7 @@ function (Parent, Settings, Nc, Assert, PlayerController) {
var callback = function(arrowMesh) {
self.arrowMesh = arrowMesh;
};
Nc.trigger(Nc.ns.client.view.playerArrow.createAndAdd, callback, options);
nc.trigger(nc.ns.client.view.playerArrow.createAndAdd, callback, options);
};
Me.prototype.render = function() {
@ -120,7 +120,7 @@ function (Parent, Settings, Nc, Assert, PlayerController) {
x: position.x * Settings.RATIO,
y: position.y * Settings.RATIO,
};
Nc.trigger(Nc.ns.client.view.playerArrow.update, this.arrowMesh, options);
nc.trigger(nc.ns.client.view.playerArrow.update, this.arrowMesh, options);
};
return Me;

View file

@ -7,7 +7,7 @@ define([
"Game/Client/View/DomController"
],
function (ProtocolHelper, GameController, User, Nc, Settings, domController) {
function (ProtocolHelper, GameController, User, nc, Settings, domController) {
"use strict";
@ -47,8 +47,8 @@ function (ProtocolHelper, GameController, User, Nc, Settings, domController) {
ProtocolHelper.applyCommand(message, self);
});
Nc.on(Nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this);
Nc.on(Nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this);
nc.on(nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this);
nc.on(nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this);
domController.setNick(nickname);
}

View file

@ -8,7 +8,7 @@ define([
"Game/Client/View/Pixi/Layers/Debug"
],
function (Parent, Settings, domController, Box2D, Nc, DebugDraw, debugLayer) {
function (Parent, Settings, domController, Box2D, nc, DebugDraw, debugLayer) {
"use strict";
@ -17,7 +17,7 @@ function (Parent, Settings, domController, Box2D, Nc, DebugDraw, debugLayer) {
this.debugMode = false;
Nc.on(Nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this);
nc.on(nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this);
}
Engine.prototype = Object.create(Parent.prototype);

View file

@ -4,7 +4,7 @@ define([
"Game/Config/Settings"
],
function (Parent, Nc, Settings) {
function (Parent, nc, Settings) {
"use strict";
@ -17,7 +17,7 @@ function (Parent, Nc, Settings) {
this.initHealthBar();
this.ncTokens = (this.ncTokens || []).concat([
Nc.on(Nc.ns.client.game.events.render, this.render, this)
nc.on(nc.ns.client.game.events.render, this.render, this)
]);
}
@ -47,7 +47,7 @@ function (Parent, Nc, Settings) {
var callback = function(healthBarView) {
self.healthBarView = healthBarView;
}
Nc.trigger(Nc.ns.client.view.healthBar.createAndAdd, callback, options);
nc.trigger(nc.ns.client.view.healthBar.createAndAdd, callback, options);
};
Player.prototype.onHealthChange = function() {
@ -75,15 +75,15 @@ function (Parent, Nc, Settings) {
healthFactor: this.stats.health / 100,
visible: this.healthBarViewVisible
};
Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, options);
nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, options);
this.healthBarViewVisibleTimeout = setTimeout(function() {
self.healthBarViewVisible = false;
Nc.trigger(Nc.ns.client.view.healthBar.update, self.healthBarView, {visible: self.healthBarViewVisible});
nc.trigger(nc.ns.client.view.healthBar.update, self.healthBarView, {visible: self.healthBarViewVisible});
}, Settings.HEALTH_DISPLAY_TIME * 1000);
} else {
Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, {visible: this.healthBarViewVisible});
nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, {visible: this.healthBarViewVisible});
}
};
@ -100,7 +100,7 @@ function (Parent, Nc, Settings) {
x: position.x * Settings.RATIO,
y: position.y * Settings.RATIO,
}
Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, options);
nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, options);
}
};
@ -110,8 +110,8 @@ function (Parent, Nc, Settings) {
Player.prototype.destroy = function() {
clearTimeout(this.healthBarViewVisibleTimeout);
Nc.trigger(Nc.ns.client.view.healthBar.remove, this.healthBarView);
Nc.off(this.ncTokens);
nc.trigger(nc.ns.client.view.healthBar.remove, this.healthBarView);
nc.off(this.ncTokens);
Parent.prototype.destroy.call(this);
};

View file

@ -3,7 +3,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Qs, Nc) {
function (Qs, nc) {
"use strict";
@ -21,7 +21,7 @@ function (Qs, Nc) {
document.addEventListener('webkitpointerlockchange', this.update.bind(this), false);
this.ncTokens = [
Nc.on(Nc.ns.client.pointerLock.request, this.request, this)
nc.on(nc.ns.client.pointerLock.request, this.request, this)
];
}
@ -40,7 +40,7 @@ function (Qs, Nc) {
// called by the browser event and others
PointerLockManager.prototype.update = function(e, options) {
options = options ? options : {};
Nc.trigger(Nc.ns.client.pointerLock.change, this.isLocked(), options);
nc.trigger(nc.ns.client.pointerLock.change, this.isLocked(), options);
};
PointerLockManager.prototype.isLocked = function() {

View file

@ -3,7 +3,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Abstract, Nc) {
function (Abstract, nc) {
"use strict";
@ -59,7 +59,7 @@ function (Abstract, Nc) {
Layer.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -6,7 +6,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Abstract, domController, Settings, Exception, Nc) {
function (Abstract, domController, Settings, Exception, nc) {
"use strict";
@ -16,14 +16,14 @@ function (Abstract, domController, Settings, Exception, Nc) {
this.debugMode = false;
this.ncTokens = [
Nc.on(Nc.ns.client.view.display.change, this.onDisplaySizeChange, this),
Nc.on(Nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this),
nc.on(nc.ns.client.view.display.change, this.onDisplaySizeChange, this),
nc.on(nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this),
Nc.on(Nc.ns.client.game.zoomIn, this.onZoomIn, this),
Nc.on(Nc.ns.client.game.zoomOut, this.onZoomOut, this),
Nc.on(Nc.ns.client.game.zoomReset, this.onZoomReset, this),
nc.on(nc.ns.client.game.zoomIn, this.onZoomIn, this),
nc.on(nc.ns.client.game.zoomOut, this.onZoomOut, this),
nc.on(nc.ns.client.game.zoomReset, this.onZoomReset, this),
Nc.on(Nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this),
nc.on(nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this),
];
}
@ -98,7 +98,7 @@ function (Abstract, domController, Settings, Exception, Nc) {
AbstractView.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -6,7 +6,7 @@ define([
"Game/Client/PointerLockManager"
],
function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
function (Settings, nc, Screenfull, Graph, PointerLockManager) {
"use strict";
@ -122,7 +122,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
var checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.onclick = function(e) {
Nc.trigger(Nc.ns.client.view.debugMode.toggle, e.target.checked);
nc.trigger(nc.ns.client.view.debugMode.toggle, e.target.checked);
};
label.appendChild(checkbox);
label.appendChild(document.createTextNode("Debug"));
@ -147,7 +147,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
// FIXME : isn't this a weird place for this?
window.onresize = function() {
Nc.trigger(Nc.ns.client.view.display.change);
nc.trigger(nc.ns.client.view.display.change);
};
};
@ -180,7 +180,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
};
DomController.prototype.initCanvas = function (canvas) {
Nc.trigger(Nc.ns.client.view.display.change, Screenfull.isFullscreen);
nc.trigger(nc.ns.client.view.display.change, Screenfull.isFullscreen);
};
DomController.prototype.setConnected = function(connected) {

View file

@ -4,7 +4,7 @@ define([
"Game/Client/View/Pixi/Layer"
],
function (Nc, Exception, Layer) {
function (nc, Exception, Layer) {
"use strict";
@ -13,16 +13,16 @@ function (Nc, Exception, Layer) {
this.container = container;
this.ncTokens = [
Nc.on(Nc.ns.client.view.layer.createAndInsert, this.createAndInsert, this),
Nc.on(Nc.ns.client.view.mesh.create, this.createMesh, this),
Nc.on(Nc.ns.client.view.animatedMesh.create, this.createAnimatedMesh, this),
Nc.on(Nc.ns.client.view.mesh.add, this.addMesh, this),
Nc.on(Nc.ns.client.view.mesh.remove, this.removeMesh, this),
Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this),
Nc.on(Nc.ns.client.view.mesh.addFilter, this.addFilter, this),
Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this),
Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this),
Nc.on(Nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this)
nc.on(nc.ns.client.view.layer.createAndInsert, this.createAndInsert, this),
nc.on(nc.ns.client.view.mesh.create, this.createMesh, this),
nc.on(nc.ns.client.view.animatedMesh.create, this.createAnimatedMesh, this),
nc.on(nc.ns.client.view.mesh.add, this.addMesh, this),
nc.on(nc.ns.client.view.mesh.remove, this.removeMesh, this),
nc.on(nc.ns.client.view.mesh.update, this.updateMesh, this),
nc.on(nc.ns.client.view.mesh.addFilter, this.addFilter, this),
nc.on(nc.ns.client.view.mesh.removeFilter, this.removeFilter, this),
nc.on(nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this),
nc.on(nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this)
];
}
@ -171,7 +171,7 @@ function (Nc, Exception, Layer) {
LayerManager.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
for (var i = this.layers.length - 1; i >= 0; i--) {
var layer = this.layers[i];

View file

@ -5,7 +5,7 @@ define([
"Lib/Vendor/Screenfull"
],
function (Settings, Nc, Stats, Screenfull) {
function (Settings, nc, Stats, Screenfull) {
"use strict";

View file

@ -5,7 +5,7 @@ define([
"Lib/Utilities/ColorConverter"
],
function (PIXI, Nc, Settings, ColorConverter) {
function (PIXI, nc, Settings, ColorConverter) {
"use strict";
@ -63,8 +63,8 @@ function (PIXI, Nc, Settings, ColorConverter) {
this.sortedPlayers = [];
this.ncTokens = [
Nc.on(Nc.ns.client.view.gameStats.toggle, this.toggle, this),
Nc.on(Nc.ns.client.view.gameStats.update, this.update, this)
nc.on(nc.ns.client.view.gameStats.toggle, this.toggle, this),
nc.on(nc.ns.client.view.gameStats.update, this.update, this)
];
}
@ -197,7 +197,7 @@ function (PIXI, Nc, Settings, ColorConverter) {
GameStats.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -7,7 +7,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) {
function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, nc) {
"use strict";
@ -23,7 +23,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) {
}
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this)
nc.on(nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this)
]);
if (Settings.SHOW_LAYER_INFO) {

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
"use strict";
@ -13,12 +13,12 @@ function (Parent, PIXI, Nc, Settings) {
Parent.call(this, "ghost", {parallaxSpeed: 0});
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this),
Nc.on(Nc.ns.client.view.playerArrow.createAndAdd, this.onCreateAndAddPlayerArrow, this),
Nc.on(Nc.ns.client.view.playerArrow.update, this.onUpdatePlayerArrow, this),
Nc.on(Nc.ns.client.view.healthBar.createAndAdd, this.onCreateAndAddHealthBar, this),
Nc.on(Nc.ns.client.view.healthBar.update, this.onUpdateHealthBar, this),
Nc.on(Nc.ns.client.view.healthBar.remove, this.onRemoveHealthBar, this),
nc.on(nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this),
nc.on(nc.ns.client.view.playerArrow.createAndAdd, this.onCreateAndAddPlayerArrow, this),
nc.on(nc.ns.client.view.playerArrow.update, this.onUpdatePlayerArrow, this),
nc.on(nc.ns.client.view.healthBar.createAndAdd, this.onCreateAndAddHealthBar, this),
nc.on(nc.ns.client.view.healthBar.update, this.onUpdateHealthBar, this),
nc.on(nc.ns.client.view.healthBar.remove, this.onRemoveHealthBar, this),
]);
}

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
"use strict";
@ -13,7 +13,7 @@ function (Parent, PIXI, Nc, Settings) {
Parent.call(this, "messages", {parallaxSpeed:-1});
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.gameStats.kill, this.onKill, this)
nc.on(nc.ns.client.view.gameStats.kill, this.onKill, this)
]);
this.mainTextOptions = {

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
function Swiper() {
Parent.call(this, "swiper", {parallaxSpeed:0});
@ -13,8 +13,8 @@ function (Parent, PIXI, Nc, Settings) {
this.static = true;
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.swiper.swipe, this.swipe, this),
Nc.on(Nc.ns.client.view.swiper.end, this.end, this)
nc.on(nc.ns.client.view.swiper.swipe, this.swipe, this),
nc.on(nc.ns.client.view.swiper.end, this.end, this)
]);
this.sprite = new PIXI.Graphics();

View file

@ -14,7 +14,7 @@ define([
"Game/Client/View/Pixi/Layers/Messages"
],
function (Parent, domController, PIXI, Settings, Nc, Exception, GameStats, LayerManager, Ghost, Swiper, PointerLockManager, Debug, Messages) {
function (Parent, domController, PIXI, Settings, nc, Exception, GameStats, LayerManager, Ghost, Swiper, PointerLockManager, Debug, Messages) {
"use strict";
@ -35,8 +35,8 @@ function (Parent, domController, PIXI, Settings, Nc, Exception, GameStats, Layer
this.init();
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.pointerLock.change, this.onPointerLockChange, this),
Nc.on(Nc.ns.core.game.events.level.loaded, this.showDefaultLayers, this)
nc.on(nc.ns.client.pointerLock.change, this.onPointerLockChange, this),
nc.on(nc.ns.core.game.events.level.loaded, this.showDefaultLayers, this)
]);
PIXI.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST;

View file

@ -7,7 +7,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Settings, Exception, AbstractView, PixiView, Nc) {
function (Settings, Exception, AbstractView, PixiView, nc) {
"use strict";

View file

@ -9,7 +9,7 @@ define([
"Lib/Utilities/Assert",
],
function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) {
function (PhysicsEngine, TiledLevel, Player, nc, Doll, GameObject, Item, Assert) {
"use strict";
@ -24,8 +24,8 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
this.physicsEngine.setCollisionDetector();
this.ncTokens = [
Nc.on(Nc.ns.core.game.worldUpdateObjects.add, this.onWorldUpdateObjectAdd, this),
Nc.on(Nc.ns.core.game.worldUpdateObjects.remove, this.onWorldUpdateObjectRemove, this)
nc.on(nc.ns.core.game.worldUpdateObjects.add, this.onWorldUpdateObjectAdd, this),
nc.on(nc.ns.core.game.worldUpdateObjects.remove, this.onWorldUpdateObjectRemove, this)
];
this.loadLevel(options.levelUid);
@ -116,10 +116,10 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
}
// FIXME ns.client in core?
Nc.trigger(Nc.ns.client.game.events.destroy);
nc.trigger(nc.ns.client.game.events.destroy);
// Testing after destroy if worldUpdateObjects is empty
// events.game.destroy -> gameobjects.destroy() -> Nc.trigger(worldUpdateObjects.remove)
// events.game.destroy -> gameobjects.destroy() -> nc.trigger(worldUpdateObjects.remove)
if(Object.keys(this.worldUpdateObjects).length > 0) {
console.warn('Not all worldUpdateObjects have been removed... ', Object.keys(this.worldUpdateObjects));
}
@ -127,7 +127,7 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
this.physicsEngine.destroy();
this.worldUpdateObjects = null;
Nc.off(this.ncTokens);
nc.off(this.ncTokens);
};
return GameController;

View file

@ -9,7 +9,7 @@ define([
"Lib/Utilities/Assert"
],
function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Assert) {
function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, nc, Assert) {
"use strict";
@ -45,7 +45,7 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser
this.createFixtures();
this.body.SetActive(false);
Nc.trigger(Nc.ns.core.game.worldUpdateObjects.add, this);
nc.trigger(nc.ns.core.game.worldUpdateObjects.add, this);
}
Doll.prototype = Object.create(Parent.prototype);
@ -481,7 +481,7 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser
};
Doll.prototype.destroy = function() {
Nc.trigger(Nc.ns.core.game.worldUpdateObjects.remove, this);
nc.trigger(nc.ns.core.game.worldUpdateObjects.remove, this);
Parent.prototype.destroy.call(this);
};

View file

@ -5,7 +5,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Box2D, Exception, Assert, Nc) {
function (Box2D, Exception, Assert, nc) {
"use strict";
@ -17,7 +17,7 @@ function (Box2D, Exception, Assert, Nc) {
this.body = physicsEngine.createBody(def);
this.ncTokens = (this.ncTokens || []).concat([
Nc.on(Nc.ns.client.game.events.destroy, this.destroy, this)
nc.on(nc.ns.client.game.events.destroy, this.destroy, this)
]);
}
@ -33,7 +33,7 @@ function (Box2D, Exception, Assert, Nc) {
throw new Exception("can not destroy body");
}
Nc.off(this.ncTokens);
nc.off(this.ncTokens);
};
GameObject.prototype.getBody = function() {

View file

@ -8,7 +8,7 @@ define([
"Lib/Utilities/Assert"
],
function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) {
function (Parent, Box2D, Options, Settings, Exception, nc, Assert) {
"use strict";
@ -41,7 +41,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) {
this.body.SetBullet(true);
}
Nc.trigger(Nc.ns.core.game.worldUpdateObjects.add, this);
nc.trigger(nc.ns.core.game.worldUpdateObjects.add, this);
}
Item.prototype = Object.create(Parent.prototype);
@ -158,7 +158,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) {
};
Item.prototype.destroy = function() {
Nc.trigger(Nc.ns.core.game.worldUpdateObjects.remove, this);
nc.trigger(nc.ns.core.game.worldUpdateObjects.remove, this);
Parent.prototype.destroy.call(this);
};

View file

@ -8,7 +8,7 @@ define([
"Game/Config/ItemSettings",
],
function (Parent, Box2D, Settings, Nc, Assert, Options, ItemSettings) {
function (Parent, Box2D, Settings, nc, Assert, Options, ItemSettings) {
"use strict";

View file

@ -9,7 +9,7 @@ define([
"json!Game/Asset/RubeDoll.json" // using requirejs json loader plugin
],
function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, Matrix, RubeDollJson) {
function (Parent, RubeLoader, Box2D, Settings, Assert, nc, Matrix, RubeDollJson) {
"use strict";

View file

@ -7,7 +7,7 @@ define([
"Lib/Utilities/Assert"
],
function (Parent, Box2D, Settings, Exception, Nc, Assert) {
function (Parent, Box2D, Settings, Exception, nc, Assert) {
"use strict";

View file

@ -10,7 +10,7 @@ define([
"Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll",
"Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll"
], function (Settings, Box2D, Nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, RubeDoll) {
], function (Settings, Box2D, nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, RubeDoll) {
"use strict";
@ -34,7 +34,7 @@ define([
Level.prototype.setup = function(levelData) { // jshint unused:false
this.isLoaded = true;
Nc.trigger(Nc.ns.core.game.events.level.loaded);
nc.trigger(nc.ns.core.game.events.level.loaded);
};
Level.prototype.createItems = function(options) {

View file

@ -13,7 +13,7 @@ define([
"Game/" + GLOBALS.context + "/GameObjects/Item",
"Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard",
], function (Parent, Settings, ItemSettings, Box2D, Options, Exception, Nc, Assert, AbstractLayer, CollisionDetector, Tile, Item, Skateboard) {
], function (Parent, Settings, ItemSettings, Box2D, Options, Exception, nc, Assert, AbstractLayer, CollisionDetector, Tile, Item, Skateboard) {
"use strict";

View file

@ -5,7 +5,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Settings, Box2D, CollisionDetector, Nc) {
function (Settings, Box2D, CollisionDetector, nc) {
"use strict";
@ -19,7 +19,7 @@ function (Settings, Box2D, CollisionDetector, Nc) {
this.worldQueue = [];
this.ncTokens = [
Nc.on(Nc.ns.channel.engine.worldQueue.add, this.addToWorldQueue, this)
nc.on(nc.ns.channel.engine.worldQueue.add, this.addToWorldQueue, this)
];
}
@ -62,7 +62,7 @@ function (Settings, Box2D, CollisionDetector, Nc) {
}
Engine.prototype.destroy = function() {
Nc.offAll(this.ncTokens);
nc.offAll(this.ncTokens);
delete this.world;
};

View file

@ -9,7 +9,7 @@ define([
"Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll"
],
function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) {
function (Doll, PlayerController, Settings, nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) {
"use strict";

View file

@ -7,7 +7,7 @@ function (Exception) {
"use strict";
function populate(obj, path) {
path = path || "Nc.ns";
path = path || "nc.ns";
for(var key in obj) {
if(!obj.hasOwnProperty(key)) continue;
if(obj[key] === null) {
@ -199,15 +199,15 @@ function (Exception) {
NotificationCenter.prototype.validate = function(topic) {
if (topic === undefined) {
throw new Exception("Topic not registered in Nc. See stack trace.");
throw new Exception("Topic not registered in nc. See stack trace.");
}
if (typeof topic === 'object') {
throw new Exception("Topic bad format " + JSON.stringify(topic));
}
if (topic.indexOf("Nc.ns") !== 0) {
throw new Exception("Topic bad format, does not begin with Nc.ns. : " + topic);
if (topic.indexOf("nc.ns") !== 0) {
throw new Exception("Topic bad format, does not begin with nc.ns. : " + topic);
}
};
@ -266,7 +266,7 @@ function (Exception) {
}
}
// should be treated as a private function - use Nc.off(Array);
// should be treated as a private function - use nc.off(Array);
NotificationCenter.prototype.offAll = function (tokens) {
for (var i = 0; i < tokens.length; i++) {
this.off(tokens[i]);

View file

@ -7,7 +7,7 @@ define([
"fs"
],
function (Nc, ProtocolHelper, validate, Options, Settings, FileSystem) {
function (nc, ProtocolHelper, validate, Options, Settings, FileSystem) {
"use strict";

View file

@ -5,14 +5,14 @@ define([
"Game/Config/Settings"
],
function (User, PipeToChannel, Nc, Settings) {
function (User, PipeToChannel, nc, Settings) {
"use strict";
function Coordinator() {
this.channelPipes = {};
Nc.on(Nc.ns.server.events.controlCommand.coordinator, this.onMessage, this);
nc.on(nc.ns.server.events.controlCommand.coordinator, this.onMessage, this);
console.checkpoint('create Coordinator');
}

View file

@ -3,7 +3,7 @@ define([
"child_process"
],
function (Nc, childProcess) {
function (nc, childProcess) {
"use strict";
@ -57,10 +57,10 @@ function (Nc, childProcess) {
PipeToChannel.prototype.onMessage = function (message) {
switch(message.recipient) {
case 'coordinator':
Nc.trigger(Nc.ns.server.events.controlCommand.coordinator, message.data);
nc.trigger(nc.ns.server.events.controlCommand.coordinator, message.data);
break;
default:
Nc.trigger(Nc.ns.server.events.controlCommand.user + message.recipient, message.data);
nc.trigger(nc.ns.server.events.controlCommand.user + message.recipient, message.data);
break;
}

View file

@ -4,7 +4,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, ProtocolHelper, Nc) {
function (Parent, ProtocolHelper, nc) {
"use strict";
@ -19,7 +19,7 @@ function (Parent, ProtocolHelper, Nc) {
socketLink.on('message', this.onMessage.bind(this));
socketLink.on('disconnect', this.onDisconnect.bind(this));
Nc.on(Nc.ns.server.events.controlCommand.user + this.id, this.socketLink.send, this.socketLink);
nc.on(nc.ns.server.events.controlCommand.user + this.id, this.socketLink.send, this.socketLink);
}
User.prototype = Object.create(Parent.prototype);
@ -97,7 +97,7 @@ function (Parent, ProtocolHelper, Nc) {
User.prototype.onPing = function(timestamp) {
var message = ProtocolHelper.encodeCommand("pong", timestamp);
Nc.trigger(Nc.ns.server.events.controlCommand.user + this.id, message);
nc.trigger(nc.ns.server.events.controlCommand.user + this.id, message);
};
return User;

View file

@ -27,7 +27,7 @@ requirejs([
"Menu/Menu"
],
function (Networker, SocketIO, Settings, Exception, Nc, Menu) {
function (Networker, SocketIO, Settings, Exception, nc, Menu) {
var menu = new Menu();
menu.onRun = function(channelName, nickname) {
@ -44,7 +44,7 @@ function (Networker, SocketIO, Settings, Exception, Nc, Menu) {
var networker = new Networker(socket, channelName, nickname);
Chuck.inspector.networker = networker;
Chuck.inspector.settings = Settings;
Chuck.inspector.nc = Nc;
Chuck.inspector.nc = nc;
Chuck.inspector.resetLevel = function() { networker.sendGameCommand("resetLevel"); }
}
menu.init();

View file

@ -6,7 +6,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, ProtocolHelper, GameController, User, Nc) {
function (Parent, ProtocolHelper, GameController, User) {
function Worker () {
//this.socketLink = socketLink;
@ -40,7 +40,7 @@ function (Parent, ProtocolHelper, GameController, User, Nc) {
}
}, this);
Nc.on(Nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this);
nc.on(nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this);
}
Worker.prototype.sendCommand = function (command, options) {