mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-08-02 12:20:49 +08:00
Progress: Documentation
This commit is contained in:
@@ -81,7 +81,7 @@ GarageServerIO.addInput(myInput);
|
|||||||
### Client
|
### Client
|
||||||
|
|
||||||
#### initializeGarageServer
|
#### initializeGarageServer
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.initializeGarageServer(path, options)
|
GarageServerIO.initializeGarageServer(path, options)
|
||||||
/*
|
/*
|
||||||
@@ -110,7 +110,7 @@ Type: string
|
|||||||
Type: object literal
|
Type: object literal
|
||||||
|
|
||||||
#### addInput
|
#### addInput
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.addInput(input)
|
GarageServerIO.addInput(input)
|
||||||
```
|
```
|
||||||
@@ -119,7 +119,7 @@ GarageServerIO.addInput(input)
|
|||||||
Type: object literal
|
Type: object literal
|
||||||
|
|
||||||
#### getStates
|
#### getStates
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.getStates(callback([, playerState], [, entityState]))
|
GarageServerIO.getStates(callback([, playerState], [, entityState]))
|
||||||
```
|
```
|
||||||
@@ -134,7 +134,7 @@ Type: array of object literals
|
|||||||
Type: array of object literals
|
Type: array of object literals
|
||||||
|
|
||||||
#### getId
|
#### getId
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.getId() : playerid
|
GarageServerIO.getId() : playerid
|
||||||
```
|
```
|
||||||
@@ -143,7 +143,7 @@ GarageServerIO.getId() : playerid
|
|||||||
Type: number
|
Type: number
|
||||||
|
|
||||||
#### sendServerEvent
|
#### sendServerEvent
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.sendServerEvent(data)
|
GarageServerIO.sendServerEvent(data)
|
||||||
```
|
```
|
||||||
@@ -154,7 +154,7 @@ Type: object literal
|
|||||||
### Server
|
### Server
|
||||||
|
|
||||||
#### createGarageServer
|
#### createGarageServer
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
require('garageserver.io').createGarageServer(io, options) : GarageServerIO
|
require('garageserver.io').createGarageServer(io, options) : GarageServerIO
|
||||||
/*
|
/*
|
||||||
@@ -185,19 +185,19 @@ Type: Socket.IO instance
|
|||||||
Type: object literal
|
Type: object literal
|
||||||
|
|
||||||
#### start
|
#### start
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.start()
|
GarageServerIO.start()
|
||||||
```
|
```
|
||||||
|
|
||||||
#### stop
|
#### stop
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.stop()
|
GarageServerIO.stop()
|
||||||
```
|
```
|
||||||
|
|
||||||
#### getPlayers
|
#### getPlayers
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.getPlayers() : [,{ id, state, [,inputs], [,{ states, executionTimes }] }]
|
GarageServerIO.getPlayers() : [,{ id, state, [,inputs], [,{ states, executionTimes }] }]
|
||||||
```
|
```
|
||||||
@@ -215,7 +215,7 @@ Type: array of object literals
|
|||||||
Type: array of object literals
|
Type: array of object literals
|
||||||
|
|
||||||
#### getEntities
|
#### getEntities
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.getEntities() : [,{ id, state, [,{ state, executionTime }] }]
|
GarageServerIO.getEntities() : [,{ id, state, [,{ state, executionTime }] }]
|
||||||
```
|
```
|
||||||
@@ -230,7 +230,7 @@ Type: object literal
|
|||||||
Type: array of object literals
|
Type: array of object literals
|
||||||
|
|
||||||
#### updatePlayerState
|
#### updatePlayerState
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.updatePlayerState(id, state)
|
GarageServerIO.updatePlayerState(id, state)
|
||||||
```
|
```
|
||||||
@@ -241,7 +241,7 @@ Type: string
|
|||||||
Type: object literal
|
Type: object literal
|
||||||
|
|
||||||
#### updateEntityState
|
#### updateEntityState
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.updateEntityState(id, state)
|
GarageServerIO.updateEntityState(id, state)
|
||||||
```
|
```
|
||||||
@@ -252,7 +252,7 @@ Type: string
|
|||||||
Type: object literal
|
Type: object literal
|
||||||
|
|
||||||
#### addEntity
|
#### addEntity
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.addEntity(id)
|
GarageServerIO.addEntity(id)
|
||||||
```
|
```
|
||||||
@@ -260,7 +260,7 @@ GarageServerIO.addEntity(id)
|
|||||||
Type: string
|
Type: string
|
||||||
|
|
||||||
#### removeEntity
|
#### removeEntity
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.removeEntity(id)
|
GarageServerIO.removeEntity(id)
|
||||||
```
|
```
|
||||||
@@ -268,7 +268,7 @@ GarageServerIO.removeEntity(id)
|
|||||||
Type: string
|
Type: string
|
||||||
|
|
||||||
#### sendPlayerEvent
|
#### sendPlayerEvent
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.sendPlayerEvent(id, data)
|
GarageServerIO.sendPlayerEvent(id, data)
|
||||||
```
|
```
|
||||||
@@ -279,7 +279,7 @@ Type: string
|
|||||||
Type: object literal
|
Type: object literal
|
||||||
|
|
||||||
#### sendPlayersEvent
|
#### sendPlayersEvent
|
||||||
|
---
|
||||||
```js
|
```js
|
||||||
GarageServerIO.sendPlayersEvent(data)
|
GarageServerIO.sendPlayersEvent(data)
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user