mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-08-12 11:40:29 +08:00
Reduced size of internal JSON property names.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user