Online Server class Handles the sockets, players, games...

### Hierarchy

- Server

## Index

### Constructors

- constructor

### Properties

- lobbies
- options
- players
- socketServer

### Methods

- addPlayer
- log
- onLobbyBan
- onLobbyCreate
- onLobbyJoin
- onLobbyKick
- onLobbyTournamentContinue
- onLobbyTournamentStart
- onPlayerConnect
- onPlayerDisconnect
- removePlayer
- updateStats

## Constructors

### constructor

- new Server(options: IOptions): Server

- - Defined in server/Server.ts:30

  #### Parameters

  - ##### options: IOptions

  #### Returns Server

## Properties

### Private lobbies

lobbies: Lobby[]

- Defined in server/Server.ts:25

### Private options

options: IOptions

- Defined in server/Server.ts:32

### Private players

players: Player[]

- Defined in server/Server.ts:23

List of players in the server

### Private socketServer

socketServer: SocketServer

- Defined in server/Server.ts:30

Socket.IO Server reference

## Methods

### Private addPlayer

- addPlayer(player: Player): void

- - Defined in server/Server.ts:177

  Add a player to the server

  #### Parameters

  - ##### player: Player

    Player token

  #### Returns void

### Private log

- log(message: string): void

- - Defined in server/Server.ts:212

  Log a message to the console

  #### Parameters

  - ##### message: string

  #### Returns void

### Private onLobbyBan

- onLobbyBan(lobbyToken: string, playerToken: string): Lobby

- - Defined in server/Server.ts:94

  #### Parameters

  - ##### lobbyToken: string

  - ##### playerToken: string

  #### Returns Lobby

### Private onLobbyCreate

- onLobbyCreate(creator: Player): Lobby

- - Defined in server/Server.ts:109

  #### Parameters

  - ##### creator: Player

  #### Returns Lobby

### Private onLobbyJoin

- onLobbyJoin(player: Player, lobbyToken: string, spectating?: boolean): Lobby

- - Defined in server/Server.ts:116

  #### Parameters

  - ##### player: Player

  - ##### lobbyToken: string

  - ##### Default value spectating: boolean = false

  #### Returns Lobby

### Private onLobbyKick

- onLobbyKick(lobbyToken: string, playerToken: string): Lobby

- - Defined in server/Server.ts:80

  #### Parameters

  - ##### lobbyToken: string

  - ##### playerToken: string

  #### Returns Lobby

### Private onLobbyTournamentContinue

- onLobbyTournamentContinue(lobbyToken: string): Lobby

- - Defined in server/Server.ts:153

  #### Parameters

  - ##### lobbyToken: string

  #### Returns Lobby

### Private onLobbyTournamentStart

- onLobbyTournamentStart(lobbyToken: string, tournamentOptions: ITournamentOptions, players: string[]): Lobby

- - Defined in server/Server.ts:137

  #### Parameters

  - ##### lobbyToken: string

  - ##### tournamentOptions: ITournamentOptions

  - ##### players: string[]

  #### Returns Lobby

### Private onPlayerConnect

- onPlayerConnect(player: Player): void

- - Defined in server/Server.ts:56

  #### Parameters

  - ##### player: Player

  #### Returns void

### Private onPlayerDisconnect

- onPlayerDisconnect(player: Player): void

- - Defined in server/Server.ts:61

  #### Parameters

  - ##### player: Player

  #### Returns void

### Private removePlayer

- removePlayer(player: Player): void

- - Defined in server/Server.ts:197

  Remove a player from the server

  #### Parameters

  - ##### player: Player

    Player token

  #### Returns void

### Private updateStats

- updateStats(): void

- - Defined in server/Server.ts:168

  #### Returns void

Generated using TypeDoc