PICO Unreal Platform SDK
FPicoLeaderboardsInterface Class Reference

PicoLeaderboardsInterface class. More...

#include <Pico_Leaderboards.h>

Public Member Functions

bool Get (const FString &LeaderboardName, FGet InGetDelegate)
 Gets a specified leaderboard. More...
 
bool GetEntries (const FString &LeaderboardName, int PageIdx, int PageSize, ppfLeaderboardFilterType Filter, ppfLeaderboardStartAt StartAt, FGetEntries InGetEntriesDelegate)
 Gets a list of leaderboard entries. More...
 
bool GetEntriesAfterRank (const FString &LeaderboardName, int PageIdx, int PageSize, unsigned long long AfterRank, FGetEntriesAfterRank InGetEntriesAfterRankDelegate)
 Gets the leaderboard entries after a specified ranking. More...
 
bool GetEntriesByIds (const FString &LeaderboardName, int PageIdx, int PageSize, ppfLeaderboardStartAt StartAt, const TArray< FString > &UserIDs, FGetEntriesByIds InGetEntriesByIdsDelegate)
 Gets the leaderboard entries for a specified user. More...
 
bool WriteEntry (const FString &LeaderboardName, const int64 &Score, const FString &ExtraData, bool ForceUpdate, FWriteEntry InWriteEntryDelegate)
 Writes a user's score to the leaderboard. More...
 
bool WriteEntryWithSupplementaryMetric (const FString &LeaderboardName, const int64 &Score, const int64 &SupplementaryMetric, const FString &ExtraData, bool ForceUpdate, FWriteEntryWithSupplementaryMetric InWriteEntryWithSupplementaryMetricDelegate)
 Adds custom contents when writing a user's score to a leaderboard. More...
 

Detailed Description

PicoLeaderboardsInterface class.

Member Function Documentation

◆ Get()

bool Get ( const FString &  LeaderboardName,
FGet  InGetDelegate 
)

Gets a specified leaderboard.

Parameters
leaderboardNameLeaderboard name.
InGetDelegateWill be executed when the request has been completed. Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_LeaderboardArray *, LeaderboardList).
Returns
Bool:
  • true: success
  • false: failure

◆ GetEntries()

bool GetEntries ( const FString &  LeaderboardName,
int  PageIdx,
int  PageSize,
ppfLeaderboardFilterType  Filter,
ppfLeaderboardStartAt  StartAt,
FGetEntries  InGetEntriesDelegate 
)

Gets a list of leaderboard entries.

Parameters
leaderboardNameLeaderboard name.
pageSizeThe number of entries to return on each page.
pageIdxDefines which page of entries to return. The value = (The target page No.)-1. For example, if you want to get the first page of entries, pass 0; if you want to get the second page of entries, pass 1.
filterRestricts the scope of entries to return:
  • NONE: returns all entries of the specified leaderboard
  • FRIENDS: returns the entries of the friends of the current logged-in user
  • USER_IDS(do not pass this value): returns the entries of specified users
startAtDefines where to start returning challenge entries, the enumerations are:
  • 0: Top (return entries from top 1)
  • 1: CenteredOnViewer (place the current logged-in user's entry in the middle of the list on the first page. For example, if the total number of entries is 10, pageSize is set to 5, and the user's rank is top 5, the ranks displayed on the first page will be top 3, 4, 5, 6, and 7. Top 1 and 2 will not be displayed, and top 8, 9, and 10 will be displayed on the second page)
  • 2: CenteredOnViewerOrTop (place the current logged-in user's entry on the top of the list on the first page. For example, if the total number of entries is 10, pageSize is set to 5, and the user's rank is top 5, the ranks displayed on the first page will be top 5, 6, 7, 8, and 9. Top 1, 2, 3, and 4 will not be displayed, and top 10 will be displayed on the second page)
InGetEntriesDelegateWill be executed when the request has been completed. Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_LeaderboardEntryArray *, LeaderboardEntryList).
Returns
Bool:
  • true: success
  • false: failure


◆ GetEntriesAfterRank()

bool GetEntriesAfterRank ( const FString &  LeaderboardName,
int  PageIdx,
int  PageSize,
unsigned long long  AfterRank,
FGetEntriesAfterRank  InGetEntriesAfterRankDelegate 
)

Gets the leaderboard entries after a specified ranking.

Parameters
LeaderboardNameLeaderboard name.
PageIdxDefines which page of entries to return. The value = (The target page No.)-1. For example, if you want to get the first page of entries, pass 0; if you want to get the second page of entries, pass 1.
PageSizeThe number of entries to return on each page.
AfterRankDefines after which rank to return entries.
InGetEntriesAfterRankDelegateWill be executed when the request has been completed. Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_LeaderboardEntryArray *, LeaderboardEntryList).
Returns
Bool:
  • true: success
  • false: failure


◆ GetEntriesByIds()

bool GetEntriesByIds ( const FString &  LeaderboardName,
int  PageIdx,
int  PageSize,
ppfLeaderboardStartAt  StartAt,
const TArray< FString > &  UserIDs,
FGetEntriesByIds  InGetEntriesByIdsDelegate 
)

Gets the leaderboard entries for a specified user.

Parameters
leaderboardNameLeaderboard name.
pageSizeThe number of entries to return on each page.
pageIdxDefines which page of entries to return. The value = (The target page No.)-1. For example, if you want to get the first page of entries, pass 0; if you want to get the second page of entries, pass 1.
startAtDefines where to start returning challenge entries, the enumerations are:
  • 0: Top (return entries from top 1)
  • 1: CenteredOnViewer (place the current logged-in user's entry in the middle of the list on the first page. For example, if the total number of entries is 10, pageSize is set to 5, and the user's rank is top 5, the ranks displayed on the first page will be top 3, 4, 5, 6, and 7. Top 1 and 2 will not be displayed, and top 8, 9, and 10 will be displayed on the second page)
  • 2: CenteredOnViewerOrTop (place the current logged-in user's entry on the top of the list on the first page. For example, if the total number of entries is 10, pageSize is set to 5, and the user's rank is top 5, the ranks displayed on the first page will be top 5, 6, 7, 8, and 9. Top 1, 2, 3, and 4 will not be displayed, and top 10 will be displayed on the second page)
userIDsUser ID.
InGetEntriesByIdsDelegateWill be executed when the request has been completed. Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, UPico_LeaderboardEntryArray *, LeaderboardEntryList).
Returns
Bool:
  • true: success
  • false: failure


◆ WriteEntry()

bool WriteEntry ( const FString &  LeaderboardName,
const int64 &  Score,
const FString &  ExtraData,
bool  ForceUpdate,
FWriteEntry  InWriteEntryDelegate 
)

Writes a user's score to the leaderboard.

Parameters
leaderboardNameLeaderboard name.
scoreThe user's score.
extraDataCustom extension fields that can be used to record key information when writing the user's score.
forceUpdateWhether to force a leaderboard update:
  • true: make a force update
  • false: no force update
    Parameters
    InWriteEntryDelegateWill be executed when the request has been completed. Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, bool, WriteResult).
    Returns
    Bool:
    • true: success
    • false: failure

◆ WriteEntryWithSupplementaryMetric()

bool WriteEntryWithSupplementaryMetric ( const FString &  LeaderboardName,
const int64 &  Score,
const int64 &  SupplementaryMetric,
const FString &  ExtraData,
bool  ForceUpdate,
FWriteEntryWithSupplementaryMetric  InWriteEntryWithSupplementaryMetricDelegate 
)

Adds custom contents when writing a user's score to a leaderboard.

Parameters
leaderboardNameLeaderboard name.
scoreThe user's score.
supplementaryMetricCustom contents, such as a video.
extraDataCustom extension fields that can be used to record key information when writing the custom contents.
forceUpdateWhether to force a leaderboard update:
  • true: make a force update
  • false: no force update
    Parameters
    InWriteEntryWithSupplementaryMetricDelegateWill be executed when the request has been completed. Delegate will contain the requested object class (bool, bIsError, const FString&, ErrorMessage, bool, WriteResult).
    Returns
    Bool:
    • true: success
    • false: failure