docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class UpdateRequest

    The body of an Update Lobby request.

    Inheritance
    object
    UpdateRequest
    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 = "UpdateRequest")]
    public class UpdateRequest

    Constructors

    UpdateRequest(string, int?, bool?, bool?, Dictionary<string, DataObject>, string, string)

    The body of an Update Lobby request.

    Declaration
    [Preserve]
    public UpdateRequest(string name = null, int? maxPlayers = null, bool? isPrivate = null, bool? isLocked = null, Dictionary<string, DataObject> data = null, string hostId = 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. Must be greater than or equal to the current number of players in 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.

    Dictionary<string, DataObject> data

    Custom game-specific properties to add, update, or remove from the lobby (e.g. mapName or gameType). To remove an existing property, include it in data but set the property object to null. To update the value to null, set the value property of the object to null.

    string hostId

    The ID of the player to make the host of the lobby. As soon as this is updated, the current host will no longer have permission to modify the lobby.

    string password

    Updates the password for this lobby. If previously unspecified, HasPassword set to true. If becoming null, HasPassword will be set to false. All future joins will be rejected unless provided password matches.

    Properties

    Data

    Custom game-specific properties to add, update, or remove from the lobby (e.g. mapName or gameType). To remove an existing property, include it in data but set the property object to null. To update the value to null, set the value property of the object to null.

    Declaration
    [Preserve]
    [JsonConverter(typeof(JsonObjectCollectionConverter))]
    [DataMember(Name = "data", EmitDefaultValue = false)]
    public JsonObject Data { get; }
    Property Value
    Type Description
    JsonObject

    HostId

    The ID of the player to make the host of the lobby. As soon as this is updated, the current host will no longer have permission to modify the lobby.

    Declaration
    [Preserve]
    [DataMember(Name = "hostId", EmitDefaultValue = false)]
    public string HostId { get; }
    Property Value
    Type Description
    string

    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. Must be greater than or equal to the current number of players in the lobby.

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

    Password

    Updates the password for this lobby. If previously unspecified, HasPassword set to true. If becoming null, HasPassword will be set to false. All future joins will be rejected unless provided password matches.

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