Reduced size of internal JSON property names.

This commit is contained in:
Jeremiah Billmann
2014-11-15 02:52:24 +00:00
parent 06ecaacb91
commit ac4bc7be48
2 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -346,15 +346,15 @@ var GarageServerIO = (function (socketio) {
},
update = function (data) {
_stateController.setTime(data.time);
_stateController.setTime(data.t);
updatePlayers(data);
updateEntities(data);
},
updatePlayers = function (data) {
data.playerStates.forEach(function (playerState) {
updateEntity(_playerController, playerState, data.time);
data.ps.forEach(function (playerState) {
updateEntity(_playerController, playerState, data.t);
if (_options.onPlayerUpdate) {
_options.onPlayerUpdate(playerState[1]);
@@ -363,8 +363,8 @@ var GarageServerIO = (function (socketio) {
},
updateEntities = function (data) {
data.entityStates.forEach(function (entityState) {
updateEntity(_entityController, entityState, data.time);
data.es.forEach(function (entityState) {
updateEntity(_entityController, entityState, data.t);
if (_options.onEntityUpdate) {
_options.onEntityUpdate(entityState[1]);
+5 -5
View File
@@ -27,17 +27,17 @@ GarageServerGame.prototype.stop = function () {
GarageServerGame.prototype.broadcastState = function () {
var i = 0, currentTime = new Date().getTime() - this.startTime,
state = { time: currentTime, playerStates: [], entityStates: [] };
state = { t: currentTime, ps: [], es: [] };
if (this.regions.length > 0) {
for (i = 0; i < this.regions.length; i ++) {
state.playerStates = this.getStateByRegion(this.playerController, this.regions[i]);
state.entityStates = this.getStateByRegion(this.entityController, this.regions[i]);
state.ps = this.getStateByRegion(this.playerController, this.regions[i]);
state.es = this.getStateByRegion(this.entityController, this.regions[i]);
this.broadcastCallback(state, this.regions[i]);
}
} else {
state.playerStates = this.getState(this.playerController);
state.entityStates = this.getState(this.entityController);
state.ps = this.getState(this.playerController);
state.es = this.getState(this.entityController);
this.broadcastCallback(state);
}
};