v0.8.2
Function: createGameServer
▸ createGameServer(server
, authModule?
, serverTransportModule?
, options?
): Object
Parameters
Name | Type | Description |
---|---|---|
server | Server <typeof IncomingMessage , typeof ServerResponse > | - |
authModule? | AuthModule | - |
serverTransportModule? | ServerTransportModule | - |
options? | Object | - |
options.reconnectionTimeoutMs? | number | Optional timeout in milliseconds for player reconnection. When a player disconnects, their game state is preserved for this duration. If they reconnect within this time, they continue from where they left off. If they don’t reconnect within this time, they are removed from the game. Default is 600000 (10 minutes). Set to 0 to disable reconnection. |
Returns
Object
Name | Type |
---|---|
eventBus | EventBus |
gameManager | GameManager |
lobby | Lobby |
messageRouter | MessageRouter |
tableFactory | TableFactory |
transport | { auth : undefined | AuthModule = authModule; server : undefined | ServerTransportModule = serverTransportModule } |
transport.auth | undefined | AuthModule |
transport.server | undefined | ServerTransportModule |
wsManager | WebSocketManager |