Constructor
new exports(socket, userDataopt)
Send game state to client
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
socket | Socket | socket to wrap | |
userData | object | <optional> | user data |
- Source
Members
lastStateSend :State|null
last state send to client use to compute GameStateDiff
Type:
- State |
null
- Source
socket :Socket
socket embeded
Type:
- Socket
- Source
userData :object
Type:
- object
- Source
Methods
sendState(stateJSON)
Send a statediff or a state to client
Parameters:
Name | Type | Description |
---|---|---|
stateJSON | object | state serialized |
- Source