docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PlayerUpdateRequest

    The body of an Update Player Data request.

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

    Constructors

    PlayerUpdateRequest(string, Dictionary<string, PlayerDataObject>, string)

    The body of an Update Player Data request.

    Declaration
    [Preserve]
    public PlayerUpdateRequest(string connectionInfo = null, Dictionary<string, PlayerDataObject> data = null, string allocationId = null)
    Parameters
    Type Name Description
    string connectionInfo

    Connection information for connecting to a relay with this player.

    Dictionary<string, PlayerDataObject> data

    Custom game-specific properties to add, update, or remove from the player (e.g. role or skill). 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 allocationId

    The allocationId from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

    Properties

    AllocationId

    The allocationId from the Relay service which associates this player in this lobby with a persistent connection. When a disconnect notification is received, this value is used to identify the associated player in a lobby to mark them as disconnected.

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

    ConnectionInfo

    Connection information for connecting to a relay with this player.

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

    Data

    Custom game-specific properties to add, update, or remove from the player (e.g. role or skill). 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
    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)