Player

Represents a player.

Attributes

Name
Purpose

Uid

The ID of the player.

UserName

The username of the player.

DisplayName

The display name of the player.

ProfilePicUrl

The profile picture URL of the player. Expires in 7 days from time of generation.

Email

The email of the player. Only available if the player retrieved is the current signed in player.

JoinDate

The date the player first joined this game.

Metadata

The metadata of the player. This is visible in the Sphere app.

IsBanned

Whether the player is banned.

BanStartDate

The date and time the ban started.

BanDuration

The duration of the ban.

BanReason

The reason for the ban.

Methods

GetPlayerAchievements(string? query = null, int pageSize = 30, string? groupName = null)

Gets achievements achieved by the player. Achievements will be ordered by the date and time they were achieved.

Parameters:

  • string? query: A full-text search query, either by the display name, short description or detailed description.

  • int pageSize: The number of achievements to retrieve at a time. Defaults to 30, maximum 30.

  • string? groupName: The group ID to get achievements from.

Returns: PlayerAchievementsCursor : A cursor to get the pages of achievements, where each page has up to pageSize achievements.

Example

var cursor = CoreServices.CurrentPlayer.GetPlayerAchievements(
    "Gold",
    groupName: "group1"
);

while (cursor.HasNext) {
    var achievements = await cursor.Next();
    /* ... */
}

Possible exceptions

AuthenticationException

Exception code (AuthenticationExceptionCode)
Meaning

NotSignedIn

User is not signed in.

ListAllPlayerAchievements(string? groupName = null)

Gets an array of achievement IDs and the date the achievement was acquired by the player.

Parameters:

  • string? groupName: The group ID to get achievements from.

Returns: Task<ListedPlayerAchievement[]> : An array of the core achievement information.

Example

var achievements = await CoreServices.CurrentPlayer.ListAllPlayerAchievements(
    groupName: "group1"
);

foreach (var listedAchievement in achievements)
{
    Debug.Log(listedAchievement.AchievedDate);
}

Possible exceptions

AuthenticationException

Exception code (AuthenticationExceptionCode)
Meaning

NotSignedIn

User is not signed in.

Last updated