From 2c2a258718115f76f1e73d5c5e598b2ab2a14183 Mon Sep 17 00:00:00 2001 From: Jeremiah Billmann Date: Sat, 16 May 2015 20:52:54 -0500 Subject: [PATCH] Removed hardcode GarageServer.IO server path --- client/garageserver.io.js | 3 +++ example/public/javascripts/game.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/garageserver.io.js b/client/garageserver.io.js index 73e0997..e58769e 100644 --- a/client/garageserver.io.js +++ b/client/garageserver.io.js @@ -181,6 +181,9 @@ var GarageServerIO = (function (socketio) { initializeGarageServer = function (path, options) { _options = options; + 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.'); + } _socket = _io.connect(path + '/garageserver.io'); registerSocketEvents(); }, diff --git a/example/public/javascripts/game.js b/example/public/javascripts/game.js index ffa4a22..151883c 100644 --- a/example/public/javascripts/game.js +++ b/example/public/javascripts/game.js @@ -7,7 +7,7 @@ $(function () { window.addEventListener('resize', resizeCanvas, false); - GarageServerIO.initializeGarageServer('https://garageserver_io-c9-jbillmann.c9.io', { + GarageServerIO.initializeGarageServer('', { logging: true, onReady: startGame, onUpdatePlayerPrediction: GamePhysics.getNewPlayerState,