diff --git a/test.js b/test.js index 5c3bb31..67c48c6 100644 --- a/test.js +++ b/test.js @@ -42,30 +42,39 @@ if (global.window) { }); } } else { - var express = require('express'); - var compression = require('compression'); - var app = express(); - var server = require('http').Server(app); - app.use(compression()); - app.use('/background',express.static(__dirname + '/webxoss-client/images',{ - maxAge: '2h' - })); - app.use('/images',express.static(__dirname + '/webxoss-client/images',{ - maxAge: '30d' - })); - app.use(express.static(__dirname + '/webxoss-client')); - io = require('socket.io')(server,{ + var noStaticServe = process.argv.slice(2).some(function (arg) { + return arg === '--no-static-server'; + }); + // static server + if (!noStaticServe) { + var express = require('express'); + var compression = require('compression'); + var app = express(); + var server = require('http').Server(app); + app.use(compression()); + app.use('/background',express.static(__dirname + '/webxoss-client/images',{ + maxAge: '2h' + })); + app.use('/images',express.static(__dirname + '/webxoss-client/images',{ + maxAge: '30d' + })); + app.use(express.static(__dirname + '/webxoss-client')); + var port = 80; + process.argv.slice(2).forEach(function (arg) { + var match = arg.match(/^port=(\d+)/) + if (match) { + port = +match[1]; + } + }); + server.listen(port); + } + // game server + var gameServer = new require('http').createServer(); + io = require('socket.io')(gameServer,{ pingTimeout: 30000, maxHttpBufferSize: 1024*1024, }); - var port = 80; - process.argv.slice(2).forEach(function (arg) { - var match = arg.match(/^port=(\d+)/) - if (match) { - port = +match[1]; - } - }); - server.listen(port); + gameServer.listen(2015); } var cfg = { diff --git a/webxoss-client b/webxoss-client index 5bd921d..b69cfab 160000 --- a/webxoss-client +++ b/webxoss-client @@ -1 +1 @@ -Subproject commit 5bd921d1ee0257ed2eea4db66e821f72db8f26ae +Subproject commit b69cfabd41cbea0059b03891f0a4c900fe2dbb09