mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-03 17:10:20 +08:00
Code cleanup
This commit is contained in:
+16
-16
@@ -217,11 +217,11 @@ window.GarageServerIO = (function (window, socketio) {
|
||||
_stateController.frameTime = new Date().getTime();
|
||||
_stateController.delta = data.delta;
|
||||
|
||||
updatePlayerState(data);
|
||||
updateEntityState(data);
|
||||
updatePlayersState(data);
|
||||
updateEntitiesState(data);
|
||||
},
|
||||
|
||||
updatePlayerState = function (data) {
|
||||
updatePlayersState = function (data) {
|
||||
var playerFound = false,
|
||||
stateIdx = 0,
|
||||
playerState;
|
||||
@@ -256,11 +256,21 @@ window.GarageServerIO = (function (window, socketio) {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
updateEntityState = function (data) {
|
||||
|
||||
updateEntitiesState = function (data) {
|
||||
|
||||
},
|
||||
|
||||
|
||||
getPlayerStates = function (stateCallback) {
|
||||
if(_options.interpolation && _options.onInterpolation) {
|
||||
getPlayerStatesInterpolated(stateCallback);
|
||||
}
|
||||
else {
|
||||
getPlayerStatesCurrent(stateCallback);
|
||||
}
|
||||
stateCallback(_stateController.state);
|
||||
},
|
||||
|
||||
getPlayerStatesCurrent = function (stateCallback) {
|
||||
_playerController.forEach(function (player) {
|
||||
if (player.anyUpdates()) {
|
||||
@@ -282,16 +292,6 @@ window.GarageServerIO = (function (window, socketio) {
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getPlayerStates = function (stateCallback) {
|
||||
if(_options.interpolation && _options.onInterpolation) {
|
||||
getPlayerStatesInterpolated(stateCallback);
|
||||
}
|
||||
else {
|
||||
getPlayerStatesCurrent(stateCallback);
|
||||
}
|
||||
stateCallback(_stateController.state);
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user