Documentation
Ask or search…
K
Links

Serialize Lobby Data

Configuring LobbyInstance to easily monitor the lobby information in the Unity Editor
Create a class named LobbyInstance:
[System.Serializable]
public class LobbyInstance //Just for debug
{
public string HostId, Id, LobbyCode, Upid, EnvironmentId, Name;
public int MaxPlayers, AvailableSlots;
public bool IsPrivate, IsLocked;
public LobbyInstance(Lobby lobby)
{
HostId = lobby is null ? "" : lobby.HostId;
Id = lobby is null ? "" : lobby.Id;
LobbyCode = lobby is null ? "" : lobby.LobbyCode;
Upid = lobby is null ? "" : lobby.Upid;
EnvironmentId = lobby is null ? "" : lobby.EnvironmentId;
Name = lobby is null ? "" : lobby.Name;
MaxPlayers = lobby is null ? 8 : lobby.MaxPlayers;
AvailableSlots = lobby is null ? 8 : lobby.AvailableSlots;
IsPrivate = lobby is null ? false : lobby.IsPrivate;
IsLocked = lobby is null ? false : lobby.IsLocked;
}
}