Class Lobby
Data about an individual lobby.
Inherited Members
Namespace: Unity.Services.Apis.Lobbies
Assembly: Unity.Services.Apis.dll
Syntax
[DataContract(Name = "Lobby")]
[Preserve]
public class Lobby
Constructors
Lobby(string, string, string, string, string, int, int, bool, bool, bool, List<Player>, Dictionary<string, DataObject>, string, DateTime, DateTime, int)
Initializes a new instance of the Lobby class.
Declaration
[Preserve]
public Lobby(string id = null, string lobbyCode = null, string upid = null, string environmentId = null, string name = null, int maxPlayers = 0, int availableSlots = 0, bool isPrivate = false, bool isLocked = false, bool hasPassword = false, List<Player> players = null, Dictionary<string, DataObject> data = null, string hostId = null, DateTime created = default, DateTime lastUpdated = default, int version = 0)
Parameters
Type | Name | Description |
---|---|---|
string | id | id. |
string | lobbyCode | A short code that can be used to join a lobby. This is only visible to lobby members. Typically this is displayed to the user so they can share it with other players out-of-game. Users with the code can join a lobby even when it is private.. |
string | upid | The Unity project ID of the game.. |
string | environmentId | The ID of the environment this lobby exists in.. |
string | name | The name of the lobby. Typically this is shown in game UI to represent the lobby.. |
int | maxPlayers | The maximum number of players that can be members of the lobby.. |
int | availableSlots | The number of remaining open slots for players before the lobby becomes full.. |
bool | isPrivate | Whether or not the lobby is private. Private lobbies do not appear in query results and cannot be fetched by non-members using the GetLobby API. If the lobby is not publicly visible, the creator can share the |
bool | isLocked | Whether or not the lobby is locked. If true, new players will not be able to join.. |
bool | hasPassword | Indicates whether or not a password is required to join the lobby. Players wishing to join must provide the matching password or will be rejected.. |
List<Player> | players | The members of the lobby.. |
Dictionary<string, Data |
data | Properties of the lobby set by the host.. |
string | hostId | The ID of the player that is the lobby host.. |
Date |
created | When the lobby was created. The timestamp is in UTC and conforms to ISO 8601.. |
Date |
lastUpdated | When the lobby was last updated. The timestamp is in UTC and conforms to ISO 8601.. |
int | version | The current version of the lobby. Incremented when any non-private lobby data changes.. |
Properties
AvailableSlots
The number of remaining open slots for players before the lobby becomes full.
Declaration
[DataMember(Name = "availableSlots", EmitDefaultValue = false)]
[Preserve]
public int AvailableSlots { get; set; }
Property Value
Type | Description |
---|---|
int | The number of remaining open slots for players before the lobby becomes full. |
Created
When the lobby was created. The timestamp is in UTC and conforms to ISO 8601.
Declaration
[DataMember(Name = "created", EmitDefaultValue = false)]
[Preserve]
public DateTime Created { get; set; }
Property Value
Type | Description |
---|---|
Date |
When the lobby was created. The timestamp is in UTC and conforms to ISO 8601. |
Data
Properties of the lobby set by the host.
Declaration
[DataMember(Name = "data", EmitDefaultValue = true)]
[Preserve]
public Dictionary<string, DataObject> Data { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, Data |
Properties of the lobby set by the host. |
EnvironmentId
The ID of the environment this lobby exists in.
Declaration
[DataMember(Name = "environmentId", EmitDefaultValue = false)]
[Preserve]
public string EnvironmentId { get; set; }
Property Value
Type | Description |
---|---|
string | The ID of the environment this lobby exists in. |
HasPassword
Indicates whether or not a password is required to join the lobby. Players wishing to join must provide the matching password or will be rejected.
Declaration
[DataMember(Name = "hasPassword", EmitDefaultValue = true)]
[Preserve]
public bool HasPassword { get; set; }
Property Value
Type | Description |
---|---|
bool | Indicates whether or not a password is required to join the lobby. Players wishing to join must provide the matching password or will be rejected. |
HostId
The ID of the player that is the lobby host.
Declaration
[DataMember(Name = "hostId", EmitDefaultValue = false)]
[Preserve]
public string HostId { get; set; }
Property Value
Type | Description |
---|---|
string | The ID of the player that is the lobby host. |
Id
Gets or Sets Id
Declaration
[DataMember(Name = "id", EmitDefaultValue = false)]
[Preserve]
public string Id { get; set; }
Property Value
Type | Description |
---|---|
string |
IsLocked
Whether or not the lobby is locked. If true, new players will not be able to join.
Declaration
[DataMember(Name = "isLocked", EmitDefaultValue = true)]
[Preserve]
public bool IsLocked { get; set; }
Property Value
Type | Description |
---|---|
bool | Whether or not the lobby is locked. If true, new players will not be able to join. |
IsPrivate
Whether or not the lobby is private. Private lobbies do not appear in query results and cannot be fetched by non-members using the GetLobby API. If the lobby is not publicly visible, the creator can share the lobbyCode
with other users who can use it to join this lobby.
Declaration
[DataMember(Name = "isPrivate", EmitDefaultValue = true)]
[Preserve]
public bool IsPrivate { get; set; }
Property Value
Type | Description |
---|---|
bool | Whether or not the lobby is private. Private lobbies do not appear in query results and cannot be fetched by non-members using the GetLobby API. If the lobby is not publicly visible, the creator can share the |
LastUpdated
When the lobby was last updated. The timestamp is in UTC and conforms to ISO 8601.
Declaration
[DataMember(Name = "lastUpdated", EmitDefaultValue = false)]
[Preserve]
public DateTime LastUpdated { get; set; }
Property Value
Type | Description |
---|---|
Date |
When the lobby was last updated. The timestamp is in UTC and conforms to ISO 8601. |
LobbyCode
A short code that can be used to join a lobby. This is only visible to lobby members. Typically this is displayed to the user so they can share it with other players out-of-game. Users with the code can join a lobby even when it is private.
Declaration
[DataMember(Name = "lobbyCode", EmitDefaultValue = true)]
[Preserve]
public string LobbyCode { get; set; }
Property Value
Type | Description |
---|---|
string | A short code that can be used to join a lobby. This is only visible to lobby members. Typically this is displayed to the user so they can share it with other players out-of-game. Users with the code can join a lobby even when it is private. |
MaxPlayers
The maximum number of players that can be members of the lobby.
Declaration
[DataMember(Name = "maxPlayers", EmitDefaultValue = false)]
[Preserve]
public int MaxPlayers { get; set; }
Property Value
Type | Description |
---|---|
int | The maximum number of players that can be members of the lobby. |
Name
The name of the lobby. Typically this is shown in game UI to represent the lobby.
Declaration
[DataMember(Name = "name", EmitDefaultValue = true)]
[Preserve]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string | The name of the lobby. Typically this is shown in game UI to represent the lobby. |
Players
The members of the lobby.
Declaration
[DataMember(Name = "players", EmitDefaultValue = false)]
[Preserve]
public List<Player> Players { get; set; }
Property Value
Upid
The Unity project ID of the game.
Declaration
[DataMember(Name = "upid", EmitDefaultValue = false)]
[Preserve]
public string Upid { get; set; }
Property Value
Type | Description |
---|---|
string | The Unity project ID of the game. |
_Version
The current version of the lobby. Incremented when any non-private lobby data changes.
Declaration
[DataMember(Name = "version", EmitDefaultValue = false)]
[Preserve]
public int _Version { get; set; }
Property Value
Type | Description |
---|---|
int | The current version of the lobby. Incremented when any non-private lobby data changes. |