docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Player

    Information about a specific player creating, joining, or already in a lobby.

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

    Constructors

    Player(string, string, Dictionary<string, PlayerDataObject>, string, DateTime, DateTime, PlayerProfile)

    Information about a specific player creating, joining, or already in a lobby.

    Declaration
    [Preserve]
    public Player(string id = null, string connectionInfo = null, Dictionary<string, PlayerDataObject> data = null, string allocationId = null, DateTime joined = default, DateTime lastUpdated = default, PlayerProfile profile = null)
    Parameters
    Type Name Description
    string id

    The unique identifier for the player. If not provided for a create or join request, it will be set to the ID of the caller.

    string connectionInfo

    Connection information for connecting to a relay with this player.

    Dictionary<string, PlayerDataObject> data

    Custom game-specific properties that apply to an individual player (e.g. role or skill).

    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.

    DateTime joined

    The time at which the player joined the lobby.

    DateTime lastUpdated

    The last time the metadata for this player was updated.

    PlayerProfile profile

    profile param

    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 that apply to an individual player (e.g. role or skill).

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

    Id

    The unique identifier for the player. If not provided for a create or join request, it will be set to the ID of the caller.

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

    Joined

    The time at which the player joined the lobby.

    Declaration
    [Preserve]
    [DataMember(Name = "joined", EmitDefaultValue = false)]
    public DateTime Joined { get; set; }
    Property Value
    Type Description
    DateTime

    LastUpdated

    The last time the metadata for this player was updated.

    Declaration
    [Preserve]
    [DataMember(Name = "lastUpdated", EmitDefaultValue = false)]
    public DateTime LastUpdated { get; set; }
    Property Value
    Type Description
    DateTime

    Profile

    Parameter profile of Player

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