Class Lobby
Data about an individual lobby.
Inheritance
Inherited Members
Namespace: Unity.Services.Lobbies.Models
Syntax
public class Lobby
Constructors
Lobby(String, String, String, String, String, Int32, Int32, Boolean, Boolean, List<Player>, Dictionary<String, DataObject>, String, DateTime, DateTime, Int32, Boolean)
Data about an individual lobby.
Declaration
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, List<Player> players = null, Dictionary<string, DataObject> data = null, string hostId = null, DateTime created = default(DateTime), DateTime lastUpdated = default(DateTime), int version = 0, bool hasPassword = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | id param |
System.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. |
System.String | upid | The Unity project ID of the game. |
System.String | environmentId | The ID of the environment this lobby exists in. |
System.String | name | The name of the lobby. Typically this is shown in game UI to represent the lobby. |
System.Int32 | maxPlayers | The maximum number of players that can be members of the lobby. |
System.Int32 | availableSlots | The number of remaining open slots for players before the lobby becomes full. |
System.Boolean | 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 |
System.Boolean | isLocked | Whether or not the lobby is locked. If true, new players will not be able to join. |
System.Collections.Generic.List<Player> | players | The members of the lobby. |
System.Collections.Generic.Dictionary<System.String, DataObject> | data | Properties of the lobby set by the host. |
System.String | hostId | The ID of the player that is the lobby host. |
System.DateTime | created | When the lobby was created. The timestamp is in UTC and conforms to ISO 8601. |
System.DateTime | lastUpdated | When the lobby was last updated. The timestamp is in UTC and conforms to ISO 8601. |
System.Int32 | version | The current version of the lobby. Incremented when any non-private lobby data changes. |
System.Boolean | 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. |
Properties
AvailableSlots
The number of remaining open slots for players before the lobby becomes full.
Declaration
public int AvailableSlots { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Created
When the lobby was created. The timestamp is in UTC and conforms to ISO 8601.
Declaration
public DateTime Created { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Data
Properties of the lobby set by the host.
Declaration
public Dictionary<string, DataObject> Data { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, DataObject> |
EnvironmentId
The ID of the environment this lobby exists in.
Declaration
public string EnvironmentId { get; }
Property Value
Type | Description |
---|---|
System.String |
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
public bool HasPassword { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
HostId
The ID of the player that is the lobby host.
Declaration
public string HostId { get; }
Property Value
Type | Description |
---|---|
System.String |
Id
Parameter id of Lobby
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
System.String |
IsLocked
Whether or not the lobby is locked. If true, new players will not be able to join.
Declaration
public bool IsLocked { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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
public bool IsPrivate { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LastUpdated
When the lobby was last updated. The timestamp is in UTC and conforms to ISO 8601.
Declaration
public DateTime LastUpdated { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
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
public string LobbyCode { get; }
Property Value
Type | Description |
---|---|
System.String |
MaxPlayers
The maximum number of players that can be members of the lobby.
Declaration
public int MaxPlayers { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Name
The name of the lobby. Typically this is shown in game UI to represent the lobby.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Players
The members of the lobby.
Declaration
public List<Player> Players { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Player> |
Upid
The Unity project ID of the game.
Declaration
public string Upid { get; }
Property Value
Type | Description |
---|---|
System.String |
Version
The current version of the lobby. Incremented when any non-private lobby data changes.
Declaration
public int Version { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |