mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-09-11 11:53:23 +08:00
Removed set player state from client - should set from server
This commit is contained in:
@@ -13,8 +13,7 @@ options = {
|
||||
onPlayerConnect: function (socket),
|
||||
onPlayerInput: function (socket, input),
|
||||
onPlayerDisconnect: function (socket),
|
||||
onPing: function (socket, data),
|
||||
onPlayerState: function (socket, data),
|
||||
onPing: function (socket, data)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -62,13 +61,6 @@ GarageServer.prototype.registerSocketEvents = function (options) {
|
||||
}
|
||||
self.onPing(socket, data, options);
|
||||
});
|
||||
|
||||
socket.on('playerState', function (data) {
|
||||
if (options.logging) {
|
||||
console.log('garageserver.io:: socket playerState ' + data);
|
||||
}
|
||||
self.onPlayerState(socket, data, options);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -101,13 +93,6 @@ GarageServer.prototype.onPing = function (socket, data, options) {
|
||||
}
|
||||
};
|
||||
|
||||
GarageServer.prototype.onPlayerState = function (socket, data, options) {
|
||||
this.game.setPlayerState(socket.id, data);
|
||||
if (options.onPlayerState) {
|
||||
options.onPlayerState(socket, data);
|
||||
}
|
||||
};
|
||||
|
||||
GarageServer.prototype.start = function () {
|
||||
this.game.start();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user