v1.0.0
Latest
2022.3+

Class Player

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

Inheritance
System.Object
Player
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 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
public Player(string id = null, string connectionInfo = null, Dictionary<string, PlayerDataObject> data = null, string allocationId = null, DateTime joined = default(DateTime), DateTime lastUpdated = default(DateTime), PlayerProfile profile = null)
Parameters
TypeNameDescription
System.Stringid

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.

System.StringconnectionInfo

Connection information for connecting to a relay with this player.

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

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

System.StringallocationId

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.

System.DateTimejoined

The time at which the player joined the lobby.

System.DateTimelastUpdated

The last time the metadata for this player was updated.

PlayerProfileprofile

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

ConnectionInfo

Connection information for connecting to a relay with this player.

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

Data

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

Declaration
public Dictionary<string, PlayerDataObject> Data { get; set; }
Property Value
TypeDescription
System.Collections.Generic.Dictionary<System.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
public string Id { get; }
Property Value
TypeDescription
System.String

Joined

The time at which the player joined the lobby.

Declaration
public DateTime Joined { get; set; }
Property Value
TypeDescription
System.DateTime

LastUpdated

The last time the metadata for this player was updated.

Declaration
public DateTime LastUpdated { get; set; }
Property Value
TypeDescription
System.DateTime

Profile

Parameter profile of Player

Declaration
public PlayerProfile Profile { get; set; }
Property Value
TypeDescription
PlayerProfile