-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
executable file
·51 lines (40 loc) · 1.14 KB
/
server.js
File metadata and controls
executable file
·51 lines (40 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"use strict"
var GLOBALS = { context: "Channel" };
var requirejs = require('requirejs');
var fs = require('fs');
var inspector;
requirejs.config({
nodeRequire: require,
baseUrl: 'app',
deps: ['Lib/Utilities/Channel/Extensions']
});
var port = process.argv[2]
|| process.env.PORT
|| process.env.npm_package_config_port;
var options = {
port: port,
rootDirectory: './',
caching: 0,
logLevel: process.argv[3] || 0
};
requirejs([
"Bootstrap/HttpServer",
"Bootstrap/Socket",
"Server/Coordinator",
"Game/Config/Settings"
],
function (HttpServer, Socket, Coordinator, Settings) {
var records = fs.readdirSync(Settings.CHANNEL_RECORDING_PATH);
if (records.length > 200) {
console.warn('Too many recordings!');
}
var coordinator = new Coordinator();
var httpServer = new HttpServer(options, coordinator);
var socket = new Socket(httpServer.getServer(), options, coordinator);
inspector = {
coordinator: coordinator,
httpServer: httpServer,
socket: socket
}
});
exports = module.exports = inspector;