v1.0.0
Latest
2022.3+

Class CreateRequest

The body of a Create Lobby request.

Inheritance
System.Object
CreateRequest
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Unity.Services.Lobbies.Models
Syntax
public class CreateRequest

Constructors

CreateRequest(String, Int32, Nullable<Boolean>, Nullable<Boolean>, Player, Dictionary<String, DataObject>, String)

The body of a Create Lobby request.

Declaration
public CreateRequest(string name, int maxPlayers, bool? isPrivate = false, bool? isLocked = false, Player player = null, Dictionary<string, DataObject> data = null, string password = null)
Parameters
TypeNameDescription
System.Stringname

The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name.

System.Int32maxPlayers

The maximum number of players that can be members of the lobby.

System.Nullable<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.

System.Nullable<System.Boolean>isLocked

Whether or not the lobby is locked. If true, new players will not be able to join.

Playerplayer

player param

System.Collections.Generic.Dictionary<System.String, DataObject>data

Custom game-specific properties that apply to the lobby (e.g. mapName or gameType).

System.Stringpassword

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.

Properties

Data

Custom game-specific properties that apply to the lobby (e.g. mapName or gameType).

Declaration
public Dictionary<string, DataObject> Data { get; }
Property Value
TypeDescription
System.Collections.Generic.Dictionary<System.String, DataObject>

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
TypeDescription
System.Nullable<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
TypeDescription
System.Nullable<System.Boolean>

MaxPlayers

The maximum number of players that can be members of the lobby.

Declaration
public int MaxPlayers { get; }
Property Value
TypeDescription
System.Int32

Name

The name of the lobby that should be displayed to users. All whitespace will be trimmed from the name.

Declaration
public string Name { get; }
Property Value
TypeDescription
System.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.

Declaration
public string Password { get; }
Property Value
TypeDescription
System.String

Player

Parameter player of CreateRequest

Declaration
public Player Player { get; }
Property Value
TypeDescription
Player