Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions client/garageserver.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ var GarageServerIO = (function (socketio) {

"use strict";

if (!socketio) {
throw new Error("GarageServer.IO: Socket.IO not found. Please ensure socket.io.js is referenced before the garageserver.io.js file.");
}

function StateController() {
this.clientTime = 0;
this.renderTime = 0;
Expand Down Expand Up @@ -188,6 +184,12 @@ var GarageServerIO = (function (socketio) {

initializeGarageServer = function (path, options) {
_options = options;
if (options.socketio) {
_io = options.socketio;
}
if (!_io) {
throw new Error('GarageServer.IO Socket.IO not found. Please ensure socket.io.js is referenced before the garageserver.io.js file.');
}
if(path == null || path.length <= 0) {
throw new Error('GarageServer.IO client is missing the server path - please verify the path argument passed to GarageServerIO.initializeGarageServer.');
}
Expand Down Expand Up @@ -491,4 +493,8 @@ var GarageServerIO = (function (socketio) {
sendServerEvent: sendServerEvent
};

}) (window.io);
}) (window.io);

if (module) {
module.exports = GarageServerIO;
}