Methods
(inner) createRoom(lobby, playerId, playerName, playerAvatar, maxPlayersPerRoom)
Parameters:
Name | Type | Description |
---|---|---|
lobby |
Lobby | A Lobby is where all the rooms and the players' connections are stored |
playerId |
string | unique player id assigned once the connection is established using uuid package |
playerName |
string | name of the player sat by the client on JoinRoomRequest or the CreateRoomRequest |
playerAvatar |
integer | the avatar of the player sat by the client on JoinRoomRequest or the CreateRoomRequest |
maxPlayersPerRoom |
integer | maximum players per room, must be greater than 1 |
- Source:
(inner) exitRoom(lobby, roomId, playerId)
Parameters:
Name | Type | Description |
---|---|---|
lobby |
Lobby | A Lobby is where all the rooms and the players' connections are stored |
roomId |
string | unique room id assigned on room creation, the id is generated using uuid() module |
playerId |
string | unique player id assigned once the connection is established using uuid package |
- Source:
(inner) joinOrCreateRoom(lobby, playerId, playerName, playerAvatar, maxPlayersPerRoom)
Parameters:
Name | Type | Description |
---|---|---|
lobby |
Lobby | A Lobby is where all the rooms and the players' connections are stored |
playerId |
string | unique player id assigned once the connection is established using uuid package |
playerName |
string | name of the player sat by the client on JoinRoomRequest or the CreateRoomRequest |
playerAvatar |
integer | the avatar of the player sat by the client on JoinRoomRequest or the CreateRoomRequest |
maxPlayersPerRoom |
integer | maximum players per room, must be greater than 1 |
- Source:
(inner) joinRoom(lobby, roomId, playerId, playerName, playerAvatar)
Parameters:
Name | Type | Description |
---|---|---|
lobby |
Lobby | A Lobby is where all the rooms and the players' connections are stored |
roomId |
string | unique room id assigned on room creation, the id is generated using uuid() module |
playerId |
string | unique player id assigned once the connection is established using uuid package |
playerName |
string | name of the player sat by the client on JoinRoomRequest or the CreateRoomRequest |
playerAvatar |
integer | the avatar of the player sat by the client on JoinRoomRequest or the CreateRoomRequest |
- Source: