Progress: Client Updates

This commit is contained in:
Jeremiah Billmann
2013-06-01 15:49:49 -04:00
parent e489b86783
commit 746a43c2d8
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -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) {
+1 -1
View File
@@ -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'),