Class CreateRequest
The body of a Create Lobby request.
Inherited Members
Namespace: Unity.Services.Apis.Lobbies
Assembly: Unity.Services.Apis.dll
Syntax
[DataContract(Name = "CreateRequest")]
[Preserve]
public class CreateRequest
Constructors
CreateRequest(string, int, bool?, bool?, Player, string, Dictionary<string, DataObject>)
Initializes a new instance of the Create
Declaration
[Preserve]
public CreateRequest(string name = null, int maxPlayers = 0, bool? isPrivate = false, bool? isLocked = false, Player player = null, string password = null, Dictionary<string, DataObject> data = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name. (required). |
int | maxPlayers | The maximum number of players that can be members of the lobby. (required). |
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. (default to false). |
Player | player | player. |
string | password | The password for this lobby. If specified, the lobby will be created with HasPassword set to true. All joins will be rejected unless provided password matches.. |
Dictionary<string, Data |
data | Custom game-specific properties that apply to the lobby (e.g. |
Properties
Data
Custom game-specific properties that apply to the lobby (e.g. mapName
or gameType
).
Declaration
[DataMember(Name = "data", EmitDefaultValue = true)]
[Preserve]
public Dictionary<string, DataObject> Data { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, Data |
Custom game-specific properties that apply to the lobby (e.g. |
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 |
MaxPlayers
The maximum number of players that can be members of the lobby.
Declaration
[DataMember(Name = "maxPlayers", IsRequired = true, EmitDefaultValue = true)]
[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 that should be displayed to users. All whitespace will be trimmed from the name.
Declaration
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string | The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name. |
Password
The password for this lobby. If specified, the lobby will be created with HasPassword set to true. All joins will be rejected unless provided password matches.
Declaration
[DataMember(Name = "password", EmitDefaultValue = true)]
[Preserve]
public string Password { get; set; }
Property Value
Type | Description |
---|---|
string | The password for this lobby. If specified, the lobby will be created with HasPassword set to true. All joins will be rejected unless provided password matches. |
Player
Gets or Sets Player
Declaration
[DataMember(Name = "player", EmitDefaultValue = false)]
[Preserve]
public Player Player { get; set; }
Property Value
Type | Description |
---|---|
Player |