### Hierarchy

- SocketServer

## Index

### Constructors

- constructor

### Properties

- io
- playerSockets
- pubSub

### Methods

- addPlayerToNamespace
- handler
- onMessageFromSocket
- onPlayerDisconnect
- sendGameListToEveryone
- sendMessageToNamespace
- sendMessageToPlayer
- start
- translateSocketMessageToPubSub

## Constructors

### constructor

- new SocketServer(server: Server, gameServers: GameServerInfoConnection[]): SocketServer

- - Defined in socket/SocketServer.ts:20

  #### Parameters

  - ##### server: Server

  - ##### gameServers: GameServerInfoConnection[]

  #### Returns SocketServer

## Properties

### Private io

io: Server<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap>

- Defined in socket/SocketServer.ts:14

### Private playerSockets

playerSockets: {} = {}

- Defined in socket/SocketServer.ts:16

#### Type declaration

- ##### [key: string]: Socket

### Private pubSub

pubSub: default

- Defined in socket/SocketServer.ts:15

## Methods

### Private addPlayerToNamespace

- addPlayerToNamespace(data: ADD_PLAYER_TO_NAMESPACE_MESSAGE): void

- - Defined in socket/SocketServer.ts:79

  #### Parameters

  - ##### data: ADD_PLAYER_TO_NAMESPACE_MESSAGE

  #### Returns void

### Private handler

- handler(req: IncomingMessage, res: ServerResponse): void

- - Defined in socket/SocketServer.ts:151

  Handler for the WebSocket server. It returns a static HTML file for any request that links to the server documentation and Github page.

  #### Parameters

  - ##### req: IncomingMessage

  - ##### res: ServerResponse

  #### Returns void

### Private onMessageFromSocket

- onMessageFromSocket(player: string, event: EVENTS): (payload: unknown) => void

- - Defined in socket/SocketServer.ts:114

  Generic event forwarder from the socket to the pubsub bus

  #### Parameters

  - ##### player: string

  - ##### event: EVENTS

  #### Returns (payload: unknown) => void

  - - (payload: unknown): void

    - #### Parameters

      - ##### payload: unknown

      #### Returns void

### Private onPlayerDisconnect

- onPlayerDisconnect(player: string): () => void

- - Defined in socket/SocketServer.ts:139

  #### Parameters

  - ##### player: string

  #### Returns () => void

  - - (): void

    - #### Returns void

### Private sendGameListToEveryone

- sendGameListToEveryone(data: GameServerStatus[]): void

- - Defined in socket/SocketServer.ts:104

  #### Parameters

  - ##### data: GameServerStatus[]

  #### Returns void

### Private sendMessageToNamespace

- sendMessageToNamespace(data: BROADCAST_NAMESPACED_MESSAGE): void

- - Defined in socket/SocketServer.ts:90

  #### Parameters

  - ##### data: BROADCAST_NAMESPACED_MESSAGE

  #### Returns void

### Private sendMessageToPlayer

- sendMessageToPlayer(data: SERVER_TO_PLAYER_MESSAGE): void

- - Defined in socket/SocketServer.ts:94

  #### Parameters

  - ##### data: SERVER_TO_PLAYER_MESSAGE

  #### Returns void

### start

- start(): void

- - Defined in socket/SocketServer.ts:24

  #### Returns void

### Private translateSocketMessageToPubSub

- translateSocketMessageToPubSub(socketEvent: EVENTS): Events

- - Defined in socket/SocketServer.ts:122

  #### Parameters

  - ##### socketEvent: EVENTS

  #### Returns Events

Generated using TypeDoc