Get Players in Room

Overview

Gets the players' information of the local player's current room.
Methods
​
Called by players to begin an asynchronous operation to get the players information of the local player's current room in the Lobby server.
Class
​
​SWGetPlayersReply​
The response object when the operation finished successfully.
​SWPlayer​
The data model of a player.
​SWLobbyError​
The error that occurred when a lobby API operation failed.

Example

1
NetworkClient.Lobby.GetPlayersInRoom((successful, reply, error) =>{
2
if (successful){
3
Debug.Log("Got players " + reply);
4
foreach(SWPlayer player in reply.players){
5
Debug.Log("Player custom data: " + player.GetCustomDataString());
6
}
7
}
8
else{
9
Debug.Log("Failed to get players " + error);
10
}
11
});
Copied!
Copy link