mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-18 12:10:18 +08:00
Progress: Documentation
This commit is contained in:
@@ -118,10 +118,13 @@ Type: object literal
|
||||
GarageServerIO.getStates(callback([, playerState], [, entityState]))
|
||||
```
|
||||
|
||||
**playerState**
|
||||
**callback**
|
||||
Type: function(playerStates, entityStates)
|
||||
|
||||
**playerStates**
|
||||
Type: array of object literals
|
||||
|
||||
**entityState**
|
||||
**entityStates**
|
||||
Type: array of object literals
|
||||
|
||||
```js
|
||||
@@ -172,13 +175,34 @@ GarageServerIO.stop()
|
||||
```
|
||||
|
||||
```js
|
||||
GarageServerIO.getPlayers() : [,{ id, state, [,input1], [,{ state, executionTime }] }]
|
||||
GarageServerIO.getPlayers() : [,{ id, state, [,inputs], [,{ states, executionTimes }] }]
|
||||
```
|
||||
|
||||
**id**
|
||||
Type: string
|
||||
|
||||
**state**
|
||||
Type: object literal
|
||||
|
||||
**inputs**
|
||||
Type: array of object literals
|
||||
|
||||
**states**
|
||||
Type: array of object literals
|
||||
|
||||
```js
|
||||
GarageServerIO.getEntities() : [,{ id, state, [,{ state, executionTime }] }]
|
||||
```
|
||||
|
||||
**id**
|
||||
Type: string
|
||||
|
||||
**state**
|
||||
Type: object literal
|
||||
|
||||
**states**
|
||||
Type: array of object literals
|
||||
|
||||
```js
|
||||
GarageServerIO.updatePlayerState(id, state)
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ options = {
|
||||
api methods
|
||||
initializeGarageServer(path, options)
|
||||
addInput(input)
|
||||
getStates(callback([player1State, player2State, ...], [entity1State, entity2State, ...]))
|
||||
getStates(callback([, playerState], [, entityState]))
|
||||
getId() : playerid
|
||||
sendServerEvent(data)
|
||||
*/
|
||||
|
||||
@@ -22,8 +22,8 @@ api methods
|
||||
createGarageServer(io, options)
|
||||
start()
|
||||
stop()
|
||||
getPlayers() : [{ id, state, [input1, input2,...], [{ state1, executionTime1 }, { state2, executionTime2 }, ...] }]
|
||||
getEntities() : [{ id, state, [{ state1, executionTime1 }, { state2, executionTime2 }, ...] }]
|
||||
getPlayers() : [,{ id, state, [,inputs], [,{ states, executionTimes }] }]
|
||||
getEntities() :[,{ id, state, [,{ state, executionTime }] }]
|
||||
updatePlayerState(id, state)
|
||||
updateEntityState(id, state)
|
||||
addEntity(id)
|
||||
|
||||
Reference in New Issue
Block a user