Get Players in Room

Overview

Gets the players' information of the local player's current room.

Methods

GetPlayersInRoom(Action<bool, SWGetPlayersReply, SWLobbyError>)

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

NetworkClient.Lobby.GetPlayersInRoom((successful, reply, error) =>{
if (successful){
Debug.Log("Got players " + reply);
foreach(SWPlayer player in reply.players){
Debug.Log("Player custom data: " + player.GetCustomDataString());
}
}
else{
Debug.Log("Failed to get players " + error);
}
});