Constructor
new SocketService(httpServer, options)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
httpServer | module:http~Server | http server | ||||||||||||||||||||||||||||||
options | object | options Properties
|
- Source
Members
io :socketio.Server
Type:
- socketio.
Server
- Source
socketConnectionCallbacks :Array.<SocketCallback>
Type:
- Array.<SocketCallback>
- Source
socketDisconnectionCallbacks :Array.<SocketCallback>
Type:
- Array.<SocketCallback>
- Source
socketReadyForGamePromises :Array.<ReadyForGameCallback>
Type:
- Array.<ReadyForGameCallback>
- Source
socketWrappers :Object.<string, SocketWrapper>
socket wrappers currently connected
Type:
- Object.<string, SocketWrapper>
- Source
threads :Object.<string, Parent>
threads running a gamecontext
Type:
- Object.<string, Parent>
- Source
Methods
loadGameThreads(gameObjects3D, threadProcessPath, entryGameObject3DUUIDopt) → {Promise}
Launch thread running game context simulation
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
gameObjects3D | Array.<object> | array of gameobject3D json to simulate | |
threadProcessPath | string | path to the thread process | |
entryGameObject3DUUID | string | <optional> | uuid of default gameobject to connect socket connected |
- Source
Returns:
- a promises resolving when all thread have been initialized
- Type:
- Promise
onSocketConnection(socket)
init
Parameters:
Name | Type | Description |
---|---|---|
socket | socketio. | new socket connected to game service |
- Source
stop() → {Promise}
Stop threads + disconnect socket client + close websocket connection
- Source
Returns:
- a promise resolving when all thread have been closed
- Type:
- Promise