refactored Server and Lobby

This commit is contained in:
Jeena 2014-03-01 14:07:03 +01:00
parent 42475c9b38
commit d83376d5c7
26 changed files with 29 additions and 29 deletions

View file

@ -1,7 +1,7 @@
define([
'http',
'node-static',
'Lobby/Api'
'Server/Api'
],
function (http, nodeStatic, Api) {

View file

@ -1,7 +1,7 @@
define([
"Game/Server/GameController",
"Game/Channel/GameController",
"Lib/Utilities/NotificationCenter",
"Game/Server/User",
"Game/Channel/User",
"Lib/Utilities/Protocol/Helper",
"Lib/Utilities/Options",
"Game/Config/Settings"
@ -9,7 +9,7 @@
function (GameController, Nc, User, ProtocolHelper, Options, Settings) {
function Channel (pipeToLobby, name, options) {
function Channel (pipeToServer, name, options) {
var self = this;
@ -20,7 +20,7 @@
this.name = name;
this.users = {};
this.pipeToLobby = pipeToLobby;
this.pipeToServer = pipeToServer;
this.gameController = new GameController(this);

View file

@ -1,15 +1,15 @@
define([
"Game/Core/GameController",
"Game/Server/Physics/Engine",
"Game/Channel/Physics/Engine",
"Game/Config/Settings",
"Game/Server/Control/PlayerController",
"Game/Channel/Control/PlayerController",
"Lib/Utilities/RequestAnimFrame",
"Lib/Utilities/NotificationCenter",
"Lib/Vendor/Box2D",
"Game/Server/Player",
"Game/Server/GameObjects/GameObject",
"Game/Server/GameObjects/Doll",
"Game/Server/GameObjects/Items/RagDoll"
"Game/Channel/Player",
"Game/Channel/GameObjects/GameObject",
"Game/Channel/GameObjects/Doll",
"Game/Channel/GameObjects/Items/RagDoll"
],
function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RagDoll) {

View file

@ -1,6 +1,6 @@
define([
"Game/Core/GameObjects/Doll",
"Game/Server/GameObjects/Item",
"Game/Channel/GameObjects/Item",
"Lib/Vendor/Box2D",
"Lib/Utilities/NotificationCenter"
],

View file

@ -1,11 +1,11 @@
define([
"Lib/Utilities/NotificationCenter",
"Game/Server/Channel"
"Game/Channel/Channel"
],
function (Nc, Channel) {
function PipeToLobby (process) {
function PipeToServer (process) {
var self = this;
@ -28,7 +28,7 @@ function (Nc, Channel) {
});
}
PipeToLobby.prototype.send = function (recipient, data) {
PipeToServer.prototype.send = function (recipient, data) {
var message = {
recipient: recipient,
data: data
@ -37,10 +37,10 @@ function (Nc, Channel) {
this.process.send(message);
};
PipeToLobby.prototype.onMessage = function (message) {
PipeToServer.prototype.onMessage = function (message) {
Nc.trigger(message.recipient + '/controlCommand', message);
}
return PipeToLobby;
return PipeToServer;
});

View file

@ -8,7 +8,7 @@ function() {
return f + this.substr(1);
}
if(GLOBALS.context == "Server") {
if(GLOBALS.context == "Channel") {
console.checkpoint = function (s) {
console.log(' \033[32mbeep - \033[0m' + s);

View file

@ -66,7 +66,7 @@ function () {
}
},
server: {
pipeToLobby: function(v) { return v + "-ns.server.pipeToLobby")}
pipeToServer: function(v) { return v + "-ns.server.pipeToServer")}
},
lobby: {

View file

@ -1,7 +1,7 @@
define([
"Lobby/User",
"Game/Server/Channel",
"Lobby/PipeToChannel",
"Server/User",
"Game/Channel/Channel",
"Server/PipeToChannel",
"Lib/Utilities/NotificationCenter"
],

View file

@ -1,4 +1,4 @@
GLOBALS = { context: "Server" };
GLOBALS = { context: "Channel" };
var requirejs = require('requirejs');
requirejs.config({
@ -10,11 +10,11 @@ requirejs.config({
var inspector = {};
requirejs([
"Game/Server/PipeToLobby"
"Game/Channel/PipeToServer"
],
function (PipeToLobby) {
var PipeToLobby = new PipeToLobby(process);
function (PipeToServer) {
var PipeToServer = new PipeToServer(process);
inspector.PipeToLobby = PipeToLobby;
inspector.PipeToServer = PipeToServer;
});

View file

@ -1,4 +1,4 @@
GLOBALS = { context: "Server" };
GLOBALS = { context: "Channel" };
var requirejs = require('requirejs');
var inspector;
@ -23,7 +23,7 @@ var options = {
requirejs([
"Bootstrap/HttpServer",
"Bootstrap/Socket",
"Lobby/Coordinator"
"Server/Coordinator"
],
function (HttpServer, Socket, Coordinator) {