forked from nodeGame/nodegame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlauncher.js
More file actions
59 lines (47 loc) · 1.41 KB
/
launcher.js
File metadata and controls
59 lines (47 loc) · 1.41 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
52
53
54
55
56
57
58
59
/**
* # Launcher file for nodeGame Server
* Copyright(c) 2015 Stefano Balietti
* MIT Licensed
*
* Sets conf, log, and games directory and start the server.
*
* http://www.nodegame.org
*/
// Load the Node.js path object.
var path = require('path');
// Load the ServerNode class.
var ServerNode = require('nodegame-server').ServerNode;
// Overrides some of the default options for ServerNode.
var options = {
// Additional conf directory.
confDir: './conf',
// Log Dir
logDir: './log',
servernode: function(servernode) {
// Special configuration for the ServerNode object.
// Adds a new game directory (Default is nodegame-server/games).
servernode.gamesDirs.push('./games');
// Sets the debug mode, exceptions will be thrown (Default is false).
// servernode.debug = true;
return true;
},
http: function(http) {
// Special configuration for Express goes here.
return true;
},
sio: function(sio) {
// Special configuration for Socket.Io goes here here.
// sio.set('transports', [
// 'websocket'
// , 'flashsocket'
// , 'htmlfile'
// , 'xhr-polling'
// , 'jsonp-polling'
// ]);
return true;
}
};
// Start server, options parameter is optional.
var sn = new ServerNode(options);
// Exports the whole ServerNode.
module.exports = sn;