mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-06-27 16:10:34 +08:00
Progress: Client Updates
This commit is contained in:
@@ -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,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'),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user