mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
47 lines
No EOL
1.2 KiB
JavaScript
Executable file
47 lines
No EOL
1.2 KiB
JavaScript
Executable file
"use strict";
|
|
|
|
var GLOBALS = { context: "Client" };
|
|
|
|
requirejs.config({
|
|
baseUrl: 'app',
|
|
deps: ['Lib/Utilities/Client/Extensions'],
|
|
waitSeconds: 0,
|
|
paths: {
|
|
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",
|
|
"Menu/Menu"
|
|
],
|
|
|
|
function (Networker, SocketIO, Settings, Exception, 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 = SocketIO.connect("/", options);
|
|
var networker = new Networker(socket, channelName, nickname);
|
|
Chuck.inspector.networker = networker;
|
|
Chuck.inspector.settings = Settings;
|
|
Chuck.inspector.resetLevel = function() { networker.sendGameCommand("resetLevel"); }
|
|
}
|
|
menu.init();
|
|
}); |