docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface ILeaderboardsService

    Namespace: Unity.Services.Leaderboards
    Assembly: Unity.Services.Leaderboards.dll
    Syntax
    public interface ILeaderboardsService

    Methods

    AddPlayerScoreAsync(string, double, AddPlayerScoreOptions)

    Adds or updates an entry for the current player in the specified leaderboard.

    Declaration
    Task<LeaderboardEntry> AddPlayerScoreAsync(string leaderboardId, double score, AddPlayerScoreOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    double score

    Score value to be submitted

    AddPlayerScoreOptions options

    Options object with "Metadata", an object containing metadata to be stored alongside the score (defaults to null).

    Returns
    Type Description
    Task<LeaderboardEntry>

    Task for a Response object containing status code, headers, and Models.LeaderboardEntry object containing the added or updated entry.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetPlayerRangeAsync(string, GetPlayerRangeOptions)

    Gets the entries of the current player as well as the specified number of neighboring players ranked either side of the player.

    Declaration
    Task<LeaderboardScores> GetPlayerRangeAsync(string leaderboardId, GetPlayerRangeOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    GetPlayerRangeOptions options

    Options object with "RangeLimit", the number of entries either side of the player to retrieve (defaults to 5), and IncludeMetadata, whether to retrieve stored metadata (defaults to false).

    Returns
    Type Description
    Task<LeaderboardScores>

    Task for a Response object containing status code, headers, and Models.LeaderboardScores object containing the list of retrieved entries.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetPlayerScoreAsync(string, GetPlayerScoreOptions)

    Gets the entry for the current player in the specified leaderboard.

    Declaration
    Task<LeaderboardEntry> GetPlayerScoreAsync(string leaderboardId, GetPlayerScoreOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    GetPlayerScoreOptions options

    Options object with "IncludeMetadata", whether to retrieve stored metadata (defaults to false).

    Returns
    Type Description
    Task<LeaderboardEntry>

    Task for a Response object containing status code, headers, and Models.LeaderboardEntry object containing the retrieved entry.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetScoresAsync(string, GetScoresOptions)

    Gets a paginated list of entries for the specified leaderboard.

    Declaration
    Task<LeaderboardScoresPage> GetScoresAsync(string leaderboardId, GetScoresOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    GetScoresOptions options

    Options object with "Offset" and "Limit" pagination options, and "IncludeMetadata" options. "Offset" is the number of entries to skip when retrieving the leaderboard scores, defaults to 0. "Limit" is the number of leaderboard scores to return, defaults to 10. "IncludeMetadata" is whether to return stored metadata, defaults to false.

    Returns
    Type Description
    Task<LeaderboardScoresPage>

    Task for a Response object containing status code, headers, and Models.LeaderboardScoresPage object containing the paginated list of retrieved entries.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetScoresByPlayerIdsAsync(string, List<string>, GetScoresByPlayerIdsOptions)

    Gets a list of entries from the specified leaderboard for the specified player IDs.

    Declaration
    Task<LeaderboardScoresWithNotFoundPlayerIds> GetScoresByPlayerIdsAsync(string leaderboardId, List<string> playerIds, GetScoresByPlayerIdsOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    List<string> playerIds

    List of player IDs to get entries for

    GetScoresByPlayerIdsOptions options

    Options object with "IncludeMetadata", whether to retrieve stored metadata (defaults to false).

    Returns
    Type Description
    Task<LeaderboardScoresWithNotFoundPlayerIds>

    Task for a Response object containing status code, headers, and Models.LeaderboardScores object containing the list of retrieved entries.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetScoresByTierAsync(string, string, GetScoresByTierOptions)

    Gets a paginated list of entries for the specified leaderboard within the specified tier.

    Declaration
    Task<LeaderboardTierScoresPage> GetScoresByTierAsync(string leaderboardId, string tierId, GetScoresByTierOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    string tierId

    ID string of the tier

    GetScoresByTierOptions options

    Options object with "Offset" and "Limit" pagination options, and "IncludeMetadata" options. "Offset" is the number of entries to skip when retrieving the leaderboard scores, defaults to 0. "Limit" is the number of leaderboard scores to return, defaults to 10. "IncludeMetadata" is whether to return stored metadata, defaults to false.

    Returns
    Type Description
    Task<LeaderboardTierScoresPage>

    Task for a Response object containing status code, headers, and Models.LeaderboardTierScoresPage object containing the paginated list of retrieved entries.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetVersionPlayerRangeAsync(string, string, GetVersionPlayerRangeOptions)

    Gets the entries of the current player as well as the specified number of neighboring players ranked either side of the player in the specified leaderboard archive version.

    Declaration
    Task<LeaderboardVersionScores> GetVersionPlayerRangeAsync(string leaderboardId, string versionId, GetVersionPlayerRangeOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    string versionId

    ID string of the leaderboard archive version

    GetVersionPlayerRangeOptions options

    Options object with "RangeLimit", the number of entries either side of the player to retrieve (defaults to 5), and IncludeMetadata, whether to retrieve stored metadata (defaults to false).

    Returns
    Type Description
    Task<LeaderboardVersionScores>

    Task for a Response object containing status code, headers, and Models.LeaderboardVersionScores object containing the list of retrieved entries.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetVersionPlayerScoreAsync(string, string, GetVersionPlayerScoreOptions)

    Gets the entry for the current player in the specified leaderboard archive version.

    Declaration
    Task<LeaderboardVersionEntry> GetVersionPlayerScoreAsync(string leaderboardId, string versionId, GetVersionPlayerScoreOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    string versionId

    ID string of the leaderboard archive version

    GetVersionPlayerScoreOptions options

    Options object with "IncludeMetadata", whether to retrieve stored metadata (defaults to false).

    Returns
    Type Description
    Task<LeaderboardVersionEntry>

    Task for a Response object containing status code, headers, and Models.LeaderboardVersionEntry object containing the retrieved entry.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetVersionScoresAsync(string, string, GetVersionScoresOptions)

    Gets a paginated list of entries for the specified leaderboard archive version.

    Declaration
    Task<LeaderboardVersionScoresPage> GetVersionScoresAsync(string leaderboardId, string versionId, GetVersionScoresOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    string versionId

    ID string of the leaderboard archive version

    GetVersionScoresOptions options

    Options object with "Offset" and "Limit" pagination options, and "IncludeMetadata" options. "Offset" is the number of entries to skip when retrieving the leaderboard scores, defaults to 0. "Limit" is the number of leaderboard scores to return, defaults to 10. "IncludeMetadata" is whether to return stored metadata, defaults to false.

    Returns
    Type Description
    Task<LeaderboardVersionScoresPage>

    Task for a Response object containing status code, headers, and Models.LeaderboardVersionScoresPage object containing the paginated list of retrieved entries.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetVersionScoresByPlayerIdsAsync(string, string, List<string>, GetVersionScoresByPlayerIdsOptions)

    Gets a list of entries for the specified players by player ID from the specified leaderboard archive version.

    Declaration
    Task<LeaderboardVersionScoresWithNotFoundPlayerIds> GetVersionScoresByPlayerIdsAsync(string leaderboardId, string versionId, List<string> playerIds, GetVersionScoresByPlayerIdsOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    string versionId

    ID string of the leaderboard archive version

    List<string> playerIds

    List of player IDs to get scores for

    GetVersionScoresByPlayerIdsOptions options

    Options object with "IncludeMetadata", whether to retrieve stored metadata (defaults to false).

    Returns
    Type Description
    Task<LeaderboardVersionScoresWithNotFoundPlayerIds>

    Task for a Response object containing status code, headers, and Models.LeaderboardVersionScoresByPlayerIds object containing the list of retrieved entries.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetVersionScoresByTierAsync(string, string, string, GetVersionScoresByTierOptions)

    Gets a paginated list of entries from the specified leaderboard archive version and within the specified tier.

    Declaration
    Task<LeaderboardVersionTierScoresPage> GetVersionScoresByTierAsync(string leaderboardId, string versionId, string tierId, GetVersionScoresByTierOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    string versionId

    ID string of the leaderboard archive version

    string tierId

    ID string of the tier

    GetVersionScoresByTierOptions options

    Options object with "Offset" and "Limit" pagination options, and "IncludeMetadata" options. "Offset" is the number of entries to skip when retrieving the leaderboard scores, defaults to 0. "Limit" is the number of leaderboard scores to return, defaults to 10. "IncludeMetadata" is whether to return stored metadata, defaults to false.

    Returns
    Type Description
    Task<LeaderboardVersionTierScoresPage>

    Task for a Response object containing status code, headers, and Models.LeaderboardVersionTierScoresPage object containing the paginated list of retrieved entries.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    GetVersionsAsync(string, GetVersionsOptions)

    Gets the list of archived leaderboard versions for the specified leaderboard.

    Declaration
    Task<LeaderboardVersions> GetVersionsAsync(string leaderboardId, GetVersionsOptions options = null)
    Parameters
    Type Name Description
    string leaderboardId

    ID string of the leaderboard

    GetVersionsOptions options

    Options object with "Limit", the number of entries to return (starting with the most recent). Defaults to all entries

    Returns
    Type Description
    Task<LeaderboardVersions>

    Task for a Response object containing status code, headers, and Models.LeaderboardVersions object containing the list of retrieved versions.

    Exceptions
    Type Condition
    LeaderboardsException

    An exception containing a Message, Reason, and ErrorCode that can be used to determine the source of the error.

    LeaderboardsValidationException

    An exception containing a Message, Reason, ErrorCode, and Details that can be used to determine the source of the error.

    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)