### Hierarchy

- SocketServer

## Index

### Constructors

- constructor

### Properties

- io
- playerSockets
- port
- pubSub

### Methods

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

## Constructors

### constructor

- new SocketServer(port: number): SocketServer

- - Defined in src/socket/socketServer.ts:14

  #### Parameters

  - ##### port: number

  #### Returns SocketServer

## Properties

### Private io

io: Server

- Defined in src/socket/socketServer.ts:10

### Private playerSockets

playerSockets: object

- Defined in src/socket/socketServer.ts:12

#### Type declaration

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

### Private port

port: number

- Defined in src/socket/socketServer.ts:16

### Private pubSub

pubSub: PubSub

- Defined in src/socket/socketServer.ts:11

## Methods

### Private addPlayerToNamespace

- addPlayerToNamespace(data: any): void

- - Defined in src/socket/socketServer.ts:82

  #### Parameters

  - ##### data: any

  #### Returns void

### Private handler

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

- - Defined in src/socket/socketServer.ts:121

  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: Player, type: string): (Anonymous function)

- - Defined in src/socket/socketServer.ts:102

  #### Parameters

  - ##### player: Player

  - ##### type: string

  #### Returns (Anonymous function)

### Private onPlayerDisconnect

- onPlayerDisconnect(player: Player): (Anonymous function)

- - Defined in src/socket/socketServer.ts:110

  #### Parameters

  - ##### player: Player

  #### Returns (Anonymous function)

### Private sendMessageToNamespace

- sendMessageToNamespace(data: NamespacedMessage): void

- - Defined in src/socket/socketServer.ts:90

  #### Parameters

  - ##### data: NamespacedMessage

  #### Returns void

### Private sendMessageToPlayer

- sendMessageToPlayer(data: GameToPlayerMessage): void

- - Defined in src/socket/socketServer.ts:94

  #### Parameters

  - ##### data: GameToPlayerMessage

  #### Returns void

### start

- start(): void

- - Defined in src/socket/socketServer.ts:20

  #### Returns void

Generated using TypeDoc