mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
Merge branch 'restructuring' of github.com:logsol/chuck.js into restructuring
This commit is contained in:
commit
9ac1d61487
7 changed files with 32 additions and 19 deletions
11
app/Bootstrap/Client.js
Executable file
11
app/Bootstrap/Client.js
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
requirejs.config({
|
||||||
|
baseUrl: 'app'
|
||||||
|
});
|
||||||
|
|
||||||
|
var inspector = {};
|
||||||
|
|
||||||
|
requirejs(["Bootstrap/Client"], function(Client) {
|
||||||
|
|
||||||
|
var client = new Client(location.href);
|
||||||
|
inspector.client = client;
|
||||||
|
});
|
||||||
|
|
@ -36,7 +36,7 @@ function(http, nodeStatic) {
|
||||||
fileServer.serveFile('./node_modules/requirejs/require.js', 200, {}, req, res);
|
fileServer.serveFile('./node_modules/requirejs/require.js', 200, {}, req, res);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case new RegExp(/^\/lib/).test(req.url):
|
case new RegExp(/^\/app/).test(req.url):
|
||||||
fileServer.serve(req, res, function(){
|
fileServer.serve(req, res, function(){
|
||||||
self.handleFileError(res)
|
self.handleFileError(res)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
define([
|
define([
|
||||||
"Server/HttpServer",
|
"Bootstrap/HttpServer",
|
||||||
"Server/Socket",
|
"Bootstrap/Socket",
|
||||||
"Server/Coordinator"
|
"Lobby/Coordinator"
|
||||||
],
|
],
|
||||||
|
|
||||||
function(HttpServer, Socket, Coordinator) {
|
function(HttpServer, Socket, Coordinator) {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
requirejs.config({
|
|
||||||
baseUrl: 'lib'
|
|
||||||
});
|
|
||||||
|
|
||||||
var inspector = {};
|
|
||||||
|
|
||||||
requirejs(["Client/Networker", "Vendor/SocketIO"], function(Networker, SocketIO) {
|
|
||||||
var socket = SocketIO.connect(location.href);
|
|
||||||
var networker = new Networker(socket);
|
|
||||||
|
|
||||||
inspector.networker = networker;
|
|
||||||
});
|
|
||||||
15
client.js
Executable file
15
client.js
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
define([
|
||||||
|
"Game/Client/Networker",
|
||||||
|
"Lib/Vendor/SocketIO"
|
||||||
|
],
|
||||||
|
|
||||||
|
function(Networker, SocketIO) {
|
||||||
|
|
||||||
|
function Client(location) {
|
||||||
|
this.socket = SocketIO.connect(location);
|
||||||
|
this.networker = new Networker(socket);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Client;
|
||||||
|
|
||||||
|
});
|
||||||
3
package.json
Normal file → Executable file
3
package.json
Normal file → Executable file
|
|
@ -25,6 +25,5 @@
|
||||||
"node": "*"
|
"node": "*"
|
||||||
},
|
},
|
||||||
"config": { "port": "1234" },
|
"config": { "port": "1234" },
|
||||||
"private": true,
|
"private": true
|
||||||
"scripts": {"start": "node app.js"}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ var inspector = {};
|
||||||
|
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
nodeRequire: require,
|
nodeRequire: require,
|
||||||
baseUrl: 'lib'
|
baseUrl: 'app'
|
||||||
});
|
});
|
||||||
|
|
||||||
var port = process.argv[2]
|
var port = process.argv[2]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue