Get Room Custom Data

Overview

Gets the custom data of the local player's current room.

Example

// Serializable classes for room custom data
[Serializable]
public class RoomCustomData {
	public string name;
	public TeamCustomData team1;
	public TeamCustomData team2;
}

[Serializable]
public class TeamCustomData {
	public List < string > players = new List < string > ();
}
NetworkClient.Lobby.GetRoomCustomData((successful, reply, error) =>{
    if (successful){
        Debug.Log("Got room custom data " + reply);
        // Deserialize room custom data
        RoomCustomData roomCustomData = reply.GetCustomData<RoomCustomData>();
    }
    else{
        Debug.Log("Failed to get room custom data " + error);
    }
});

Last updated