diff --git a/client/garageserver.io.js b/client/garageserver.io.js index 62f7e73..a9887fa 100644 --- a/client/garageserver.io.js +++ b/client/garageserver.io.js @@ -15,11 +15,14 @@ window.GarageServerIO = (function (window, socketio) { // TODO: DONE CALLBACK connectToGarageServer = function (path, options) { socket = io.connect(path + '/garageserver.io'); - registerSocketEvents(); + registerSocketEvents(options); }, - registerSocketEvents = function () { + registerSocketEvents = function (options) { socket.on('update', function(data) { + if(options.logging) { + console.log('garageserver.io:: socket update ' + ' ' + data.id + ' ' + data.state + ' ' + data.seq); + } updatePlayerInput(data); }); socket.on('ping', function(data) { diff --git a/example/public/javascripts/game.js b/example/public/javascripts/game.js index 316f202..1b5431d 100644 --- a/example/public/javascripts/game.js +++ b/example/public/javascripts/game.js @@ -1,5 +1,5 @@ $(function () { - GarageServerIO.connectToGarageServer('http://garageserver_io.jbillmann.c9.io'); + GarageServerIO.connectToGarageServer('http://garageserver_io.jbillmann.c9.io', { logging: true }); var gameCanvas = document.getElementById('gameCanvas'),