mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-08-12 11:40:29 +08:00
Progress: client
This commit is contained in:
@@ -4,21 +4,21 @@ window.GarageServerIO = (function (window, socketio) {
|
||||
|
||||
garageServerGame = null,
|
||||
|
||||
// TODO: DONE CALLBACK
|
||||
connectToGarageServer = function (path, options) {
|
||||
io.connect(path + '/garageserver.io');
|
||||
registerSocketEvents();
|
||||
registerSocketEvents(io.connect(path + '/garageserver.io'));
|
||||
},
|
||||
|
||||
registerSocketEvents = function () {
|
||||
io.on('update', function(data) {
|
||||
registerSocketEvents = function (socket) {
|
||||
socket.on('update', function(data) {
|
||||
if(garageServerGame.addPlayerInput) {
|
||||
garageServerGame.addPlayerInput(data);
|
||||
}
|
||||
});
|
||||
io.on('ping', function(data) {
|
||||
socket.on('ping', function(data) {
|
||||
|
||||
});
|
||||
io.on('removePlayer', function(id) {
|
||||
socket.on('removePlayer', function(id) {
|
||||
if(garageServerGame.removePlayer) {
|
||||
garageServerGame.removePlayer(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user