-
Notifications
You must be signed in to change notification settings - Fork 1
/
client.js
executable file
·51 lines (45 loc) · 1.34 KB
/
client.js
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: "Client" };
requirejs.config({
baseUrl: 'app',
deps: ['Lib/Utilities/Client/Extensions'],
waitSeconds: 0,
paths: {
text: 'Lib/Vendor/RequireJs/Plugin/Text',
json: 'Lib/Vendor/RequireJs/Plugin/Json',
screenfull: "/screenfull",
chart: "/chart",
socketio: "/socket.io/socket.io"
},
});
if(!Chuck) var Chuck = {};
Chuck.inspector = {};
requirejs([
"Game/Client/Networker",
"Lib/Vendor/SocketIO",
"Game/Config/Settings",
"Lib/Utilities/Exception",
"Lib/Utilities/NotificationCenter",
"Menu/Menu"
],
function (Networker, io, Settings, Exception, nc, Menu) {
var menu = new Menu();
menu.onRun = function(channelName, nickname) {
var options = {
"reconnect": false,
"reconnection delay": 500,
"max reconnection attempts": 10,
"transports": [
"websocket",
"flashsocket"
]
};
var socket = io("/", options);
var networker = new Networker(socket, channelName, nickname);
Chuck.inspector.networker = networker;
Chuck.inspector.settings = Settings;
Chuck.inspector.nc = nc;
Chuck.inspector.resetLevel = function() { networker.sendGameCommand("resetLevel"); }
}
menu.init();
});