Join Room

Overview

Joins the private/public rooms of your game in the Lobby server.
Methods
Called by players to begin an asynchronous operation to join a room in the Lobby server using the specified roomId. This method allows players to join both private and public rooms.
Called by players to begin an asynchronous operation to randomly join a room in the Lobby server. This method allows players to join public rooms.
Called by players to begin an asynchronous operation to randomly join a room in the Lobby server. If no available rooms were found, The player will create a new room with the specified wantRT, playerLimit, and player TTL. This method allows players to join public rooms.
Class
The response object when the operation finished successfully.
The error that occurred when a lobby API operation failed.

Example

1
NetworkClient.Lobby.JoinRoom(roomId, (successful, reply, error) =>{
2
if (successful) {
3
Debug.Log("Joined room " + reply);
4
}
5
else {
6
Debug.Log("Failed to Join room " + error);
7
}
8
});
Copied!
1
NetworkClient.Lobby.JoinRoomRandomly((successful, reply, error) =>{
2
if (successful) {
3
Debug.Log("Joined room randomly " + reply);
4
}
5
else {
6
Debug.Log("Failed to Join room randomly" + error);
7
}
8
});
Copied!
1
NetworkClient.Lobby.JoinOrCreateRoom(true, 4, 60, (successful, reply, error) =>{
2
if (successful){
3
Debug.Log("Joined or created room " + reply);
4
}
5
else{
6
Debug.Log("Failed to join or create room " + error);
7
}
8
});
Copied!
Copy link