Omni One Unreal SDK 1.1.0
The Omni One Unreal SDK allows for games to interface with the Omni platform service.
All Classes Functions Variables Enumerations Enumerator Modules Pages
FOmniLeaderboardService

Description

Service for accessing and updating leaderboard information.

The Leaderboard Service is able to retrieve information about this project's leaderboards and their entries, and write new leaderboard entries for the current user.

#include <OmniLeaderboardService.h>

Inherits FOmniPlatformServiceBase.

Public Member Functions

bool Get (const FString &LeaderboardName, const FLeaderboardGetDelegate &InGetCallback) const
 Returns an array of UOmniLeaderboard objects for the provided name.
 
bool GetEntries (const FString &LeaderboardName, int32 PageSize, int32 PageIndex, EOmniLeaderboardFilterType Filter, EOmniLeaderboardStartAt StartAt, const FLeaderboardGetEntriesDelegate &InGetEntriesCallback) const
 Returns an array of UOmniLeaderboardEntry objects for the provided name.
 
bool GetEntriesAfterRank (const FString &LeaderboardName, int32 PageSize, int32 PageIndex, uint64 AfterRank, const FLeaderboardGetEntriesDelegate &InGetEntriesAfterRankCallback) const
 Retrieves a paged list of entries from the given leaderboard, starting at a specific rank.
 
bool GetEntriesByIds (const FString &LeaderboardName, int32 PageSize, int32 PageIndex, EOmniLeaderboardStartAt StartAt, const TArray< FString > &UserIds, const FLeaderboardGetEntriesDelegate &InGetEntriesByIdsCallback) const
 Retrieves a paged list of entries from the given leaderboard, containing only the specified users.
 
bool WriteEntry (const FString &LeaderboardName, const int64 Score, const FString &ExtraData, const bool bForceUpdate, const FLeaderboardWriteEntryDelegate &InWriteEntryCallback) const
 Writes a new entry to a leaderboard, tied to the current user.
 
bool WriteEntryWithSupplementaryMetric (const FString &LeaderboardName, const int64 Score, const int64 SupplementaryMetric, const FString &ExtraData, bool bForceUpdate, const FLeaderboardWriteEntryDelegate &InWriteEntryCallback) const
 Writes a new entry to a leaderboard, tied to the current user.
 

Methods

◆ Get()

bool FOmniLeaderboardService::Get ( const FString &  LeaderboardName,
const FLeaderboardGetDelegate &  InGetCallback 
) const

Returns an array of UOmniLeaderboard objects for the provided name.

Returns an array of UOmniLeaderboard objects for the provided name and executes callback with the array.

Parameters
LeaderboardNameName of the leaderboard.
InGetCallbackA callback that will be executed when the service has retrieved the information. bool bIsError, const FString& ErrorMessage, TArray<UOmniLeaderboard*>& LeaderboardArray (empty in error cases) are passed as parameters.
Returns
True if the request was sent successfully, false otherwise.

◆ GetEntries()

bool FOmniLeaderboardService::GetEntries ( const FString &  LeaderboardName,
int32  PageSize,
int32  PageIndex,
EOmniLeaderboardFilterType  Filter,
EOmniLeaderboardStartAt  StartAt,
const FLeaderboardGetEntriesDelegate &  InGetEntriesCallback 
) const

Returns an array of UOmniLeaderboardEntry objects for the provided name.

Returns an array of UOmniLeaderboardEntry objects for the provided name and executes callback with the array.

Parameters
LeaderboardNameName of the leaderboard.
PageSizeNumber of entries per page.
PageIndexIndex of the page to retrieve.
FilterUser relation filter.
StartAtStart position.
InGetEntriesCallbackA callback that will be executed when the service has retrieved the information. bool bIsError, const FString& ErrorMessage, TArray<UOmniLeaderboardEntry*>& LeaderboardArray (nullptr in error cases) are passed as parameters.
Returns
True if the request was sent successfully, false otherwise.

◆ GetEntriesAfterRank()

bool FOmniLeaderboardService::GetEntriesAfterRank ( const FString &  LeaderboardName,
int32  PageSize,
int32  PageIndex,
uint64  AfterRank,
const FLeaderboardGetEntriesDelegate &  InGetEntriesAfterRankCallback 
) const

Retrieves a paged list of entries from the given leaderboard, starting at a specific rank.

Returns an array of UOmniLeaderboardEntry objects for the provided parameters and executes callback with the array.

Parameters
LeaderboardNameName of the leaderboard.
PageSizeNumber of entries per page.
PageIndexIndex of the page to retrieve.
AfterRankThe rank where the list will start.
InGetEntriesAfterRankCallbackA callback that will be executed when the service has retrieved the information. bool bIsError, const FString& ErrorMessage, TArray<UOmniLeaderboardEntry*>& LeaderboardArray (nullptr in error cases) are passed as parameters.
Returns
True if the request was sent successfully, false otherwise.

◆ GetEntriesByIds()

bool FOmniLeaderboardService::GetEntriesByIds ( const FString &  LeaderboardName,
int32  PageSize,
int32  PageIndex,
EOmniLeaderboardStartAt  StartAt,
const TArray< FString > &  UserIds,
const FLeaderboardGetEntriesDelegate &  InGetEntriesByIdsCallback 
) const

Retrieves a paged list of entries from the given leaderboard, containing only the specified users.

Returns an array of UOmniLeaderboardEntry objects for the provided parameters and executes callback with the array.

Parameters
LeaderboardNameName of the leaderboard.
PageSizeNumber of entries per page.
PageIndexIndex of the page to retrieve.
StartAtDefines the starting point of the first page of the list.
UserIdsThe list of user IDs to retrieve entries for.
InGetEntriesByIdsCallbackA callback that will be executed when the service has retrieved the information. bool bIsError, const FString& ErrorMessage, TArray<UOmniLeaderboardEntry*>& LeaderboardArray (nullptr in error cases) are passed as parameters.
Returns
True if the request was sent successfully, false otherwise.

◆ WriteEntry()

bool FOmniLeaderboardService::WriteEntry ( const FString &  LeaderboardName,
const int64  Score,
const FString &  ExtraData,
const bool  bForceUpdate,
const FLeaderboardWriteEntryDelegate &  InWriteEntryCallback 
) const

Writes a new entry to a leaderboard, tied to the current user.

Parameters
LeaderboardNameThe API Name of the desired leaderboard.
ScoreThe score to associate with this entry.
ExtraDataAny additional required information.
bForceUpdateIf true, will update the user's score even if the new score is lower than the previous value.
InWriteEntryCallbackA callback that will be executed when the service has retrieved the information. bool bIsError, const FString& ErrorMessage, bool bWasUpdated are passed as parameters.
Returns
True if the request was sent successfully, false otherwise.

◆ WriteEntryWithSupplementaryMetric()

bool FOmniLeaderboardService::WriteEntryWithSupplementaryMetric ( const FString &  LeaderboardName,
const int64  Score,
const int64  SupplementaryMetric,
const FString &  ExtraData,
bool  bForceUpdate,
const FLeaderboardWriteEntryDelegate &  InWriteEntryCallback 
) const

Writes a new entry to a leaderboard, tied to the current user.

Parameters
LeaderboardNameThe API Name of the desired leaderboard.
ScoreThe score to associate with this entry.
SupplementaryMetricAn additional value used as a tie-breaker.
ExtraDataAny additional required information.
bForceUpdateIf true, will update the user's score even if the new score is lower than the previous value.
InWriteEntryCallbackA callback that will be executed when the service has retrieved the information. bool bIsError, const FString& ErrorMessage, bool bWasUpdated are passed as parameters.
Returns
True if the request was sent successfully, false otherwise.