diff --git a/lib/server/garageservergame.js b/lib/server/garageservergame.js index d0d4ee2..310e95d 100644 --- a/lib/server/garageservergame.js +++ b/lib/server/garageservergame.js @@ -13,13 +13,13 @@ function GarageServerGame(options) { } GarageServerGame.prototype.updateState = function (options) { - this.updatePlayers(options); - this.updateEntities(options); + var currentTime = new Date().getTime() - this.startTime; + this.updatePlayers(currentTime, options); + this.updateEntities(currentTime, options); }; -GarageServerGame.prototype.updatePlayers = function (options) { - var currentTime = new Date().getTime() - this.startTime, - state = { time: currentTime, playerStates: [] }; +GarageServerGame.prototype.updatePlayers = function (currentTime, options) { + var state = { time: currentTime, playerStates: [], entityStates: [] }; this.players.forEach(function (player) { state.playerStates.push([ player.client.id, player.state, player.sequence ]); @@ -30,7 +30,7 @@ GarageServerGame.prototype.updatePlayers = function (options) { }); }; -GarageServerGame.prototype.updateEntities = function (options) { +GarageServerGame.prototype.updateEntities = function (currentTime, options) { };