docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CreateRequest

    The body of a Create Lobby request.

    Inheritance
    object
    CreateRequest
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Services.Lobbies.Models
    Assembly: Unity.Services.Multiplayer.dll
    Syntax
    [Preserve]
    [DataContract(Name = "CreateRequest")]
    public class CreateRequest

    Constructors

    CreateRequest(string, int, bool?, bool?, Player, Dictionary<string, DataObject>, string)

    The body of a Create Lobby request.

    Declaration
    [Preserve]
    public CreateRequest(string name, int maxPlayers, bool? isPrivate = false, bool? isLocked = false, Player player = null, Dictionary<string, DataObject> data = null, string password = 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.

    int maxPlayers

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

    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 lobbyCode with other users who can use it to join this lobby.

    bool? isLocked

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

    Player player

    player param

    Dictionary<string, DataObject> data

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

    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.

    Properties

    Data

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

    Declaration
    [Preserve]
    [DataMember(Name = "data", EmitDefaultValue = false)]
    public Dictionary<string, DataObject> Data { get; }
    Property Value
    Type Description
    Dictionary<string, DataObject>

    IsLocked

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

    Declaration
    [Preserve]
    [DataMember(Name = "isLocked", EmitDefaultValue = true)]
    public bool? IsLocked { get; }
    Property Value
    Type Description
    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 lobbyCode with other users who can use it to join this lobby.

    Declaration
    [Preserve]
    [DataMember(Name = "isPrivate", EmitDefaultValue = true)]
    public bool? IsPrivate { get; }
    Property Value
    Type Description
    bool?

    MaxPlayers

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

    Declaration
    [Preserve]
    [DataMember(Name = "maxPlayers", IsRequired = true, EmitDefaultValue = true)]
    public int MaxPlayers { get; }
    Property Value
    Type Description
    int

    Name

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

    Declaration
    [Preserve]
    [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
    public string Name { get; }
    Property Value
    Type Description
    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
    [Preserve]
    [DataMember(Name = "password", EmitDefaultValue = false)]
    public string Password { get; }
    Property Value
    Type Description
    string

    Player

    Parameter player of CreateRequest

    Declaration
    [Preserve]
    [DataMember(Name = "player", EmitDefaultValue = false)]
    public Player Player { get; }
    Property Value
    Type Description
    Player
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)