mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-19 11:19:49 +08:00
Added playerId to callbacks
This commit is contained in:
@@ -10,7 +10,7 @@ options = {
|
||||
onPlayerDisconnect: function (socket),
|
||||
onPing: function (socket, data),
|
||||
onPlayerState: function (socket, data),
|
||||
onUpdatePlayerPhysics: function (state, inputs),
|
||||
onUpdatePlayerPhysics: function (id, state, inputs, deltaTime)
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ GarageServerGame.prototype.updatePhysics = function (options) {
|
||||
this.players.forEach(function (player) {
|
||||
if (player.inputs.length > 0) {
|
||||
if (options.onUpdatePlayerPhysics) {
|
||||
player.state = options.onUpdatePlayerPhysics(player.state, player.inputs, self.physicsDelta);
|
||||
player.state = options.onUpdatePlayerPhysics(player.client.id, player.state, player.inputs, self.physicsDelta);
|
||||
}
|
||||
player.sequence += player.inputs.length;
|
||||
player.inputs = [];
|
||||
|
||||
Reference in New Issue
Block a user