mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-28 11:15:16 +08:00
Progress: Client Updates
This commit is contained in:
@@ -29,7 +29,7 @@ GarageServerGame.prototype.updatePhysics = function (options) {
|
||||
|
||||
GarageServerGame.prototype.addPlayer = function (client) {
|
||||
for(var i = 0; i < this.players.length; i ++) {
|
||||
if(this.players[i].id === client.id) {
|
||||
if(this.players[i].client.id === client.id) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ GarageServerGame.prototype.addPlayer = function (client) {
|
||||
|
||||
GarageServerGame.prototype.removePlayer = function (client) {
|
||||
for(var i = 0; i < this.players.length; i ++) {
|
||||
if(this.players[i].id === client.id) {
|
||||
if(this.players[i].client.id === client.id) {
|
||||
this.players.splice(i, 1)[0];
|
||||
return;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ GarageServerGame.prototype.removePlayer = function (client) {
|
||||
|
||||
GarageServerGame.prototype.addPlayerInput = function (client, input) {
|
||||
for(var i = 0; i < this.players.length; i ++) {
|
||||
if(this.players[i].id === client.id) {
|
||||
if(this.players[i].client.id === client.id) {
|
||||
this.players[i].inputs.push(input);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user