From 24fb6e535835a6b662569d140ab911bb7ddf1312 Mon Sep 17 00:00:00 2001 From: Jeremiah Billmann Date: Thu, 4 Jul 2013 11:01:54 -0400 Subject: [PATCH] Progress #3 --- lib/server/garageservergame.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) { };