mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-05 17:30:44 +08:00
Returned literals rather than server objects
This commit is contained in:
@@ -19,8 +19,8 @@ api methods
|
||||
createGarageServer(io, options)
|
||||
start()
|
||||
stop()
|
||||
getPlayers() : [player] : { id: '', state: {}, inputs: [{}], stateHistory: [{ state, executionTime }] }
|
||||
getEntities() : [entity] : { id: '', state: {}, stateHistory: [{ state, executionTime }] }
|
||||
getPlayers() : [{ id: '', state: {}, inputs: [{}], stateHistory: [{ state, executionTime }] }]
|
||||
getEntities() : [{ id: '', state: {}, stateHistory: [{ state, executionTime }] }]
|
||||
updatePlayerState(id, state)
|
||||
updateEntityState(id, state)
|
||||
addEntity(id)
|
||||
|
||||
@@ -44,11 +44,19 @@ GarageServerGame.prototype.getState = function (controller) {
|
||||
};
|
||||
|
||||
GarageServerGame.prototype.getPlayers = function () {
|
||||
return this.playerController.entities;
|
||||
var list = [];
|
||||
this.playerController.entities.forEach(function (player) {
|
||||
list.push({ id: player.id, state: player.state, inputs: player.inputs, stateHistory: player.stateHistory });
|
||||
});
|
||||
return list;
|
||||
};
|
||||
|
||||
GarageServerGame.prototype.getEntities = function () {
|
||||
return this.entityController.entities;
|
||||
var list = [];
|
||||
this.entityController.entities.forEach(function (entity) {
|
||||
list.push({ id: entity.id, state: entity.state, stateHistory: entity.stateHistory });
|
||||
});
|
||||
return list;
|
||||
};
|
||||
|
||||
GarageServerGame.prototype.getPlayer = function (id) {
|
||||
|
||||
Reference in New Issue
Block a user