mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-08-02 12:20:49 +08:00
Code cleanup
This commit is contained in:
@@ -110,6 +110,10 @@ GarageServer.prototype.start = function () {
|
||||
this.game.start();
|
||||
};
|
||||
|
||||
GarageServer.prototype.stop = function () {
|
||||
this.game.stop();
|
||||
};
|
||||
|
||||
GarageServer.prototype.getPlayers = function () {
|
||||
return this.game.getPlayers();
|
||||
};
|
||||
|
||||
@@ -16,10 +16,14 @@ GarageServerGame.prototype.start = function () {
|
||||
var self = this;
|
||||
|
||||
this.startTime = new Date().getTime();
|
||||
this.stateIntervalId = setInterval(function () { self.updateState(self.options); }, this.stateInterval);
|
||||
this.stateIntervalId = setInterval(function () { self.updateState(); }, this.stateInterval);
|
||||
};
|
||||
|
||||
GarageServerGame.prototype.updateState = function (options) {
|
||||
GarageServerGame.prototype.stop = function () {
|
||||
clearInterval(this.stateIntervalId);
|
||||
};
|
||||
|
||||
GarageServerGame.prototype.updateState = function () {
|
||||
var currentTime = new Date().getTime() - this.startTime,
|
||||
state = { time: currentTime, playerStates: [], entityStates: [] };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user