API reference
API reference
Select your platform
No SDKs available
No versions available

OVR_Requests_Leaderboard.h File

Overview

Functions

ovr_Leaderboard_Get
( const char * leaderboardName )
ovr_Leaderboard_GetEntries
( const char * leaderboardName,
int limit,
ovr_Leaderboard_GetEntriesAfterRank
( const char * leaderboardName,
int limit,
unsigned long long afterRank )
ovr_Leaderboard_GetEntriesByIds
( const char * leaderboardName,
int limit,
ovrID * userIDs,
unsigned int userIDLength )
ovr_Leaderboard_WriteEntry
( const char * leaderboardName,
long long score,
const void * extraData,
unsigned int extraDataLength,
bool forceUpdate )
ovr_Leaderboard_WriteEntryWithSupplementaryMetric
( const char * leaderboardName,
long long score,
long long supplementaryMetric,
const void * extraData,
unsigned int extraDataLength,
bool forceUpdate )

Details

Functions

ovrRequest ovr_Leaderboard_Get
( const char * leaderboardName )
Gets the information for a single leaderboard
Parameters
leaderboardName
The name of the leaderboard to return.
A message with type ovrMessage_Leaderboard_Get will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardArrayHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardArray().
ovrRequest ovr_Leaderboard_GetEntries
( const char * leaderboardName,
int limit,
Requests a block of leaderboard entries.
Parameters
leaderboardName
The name of the leaderboard whose entries to return.
limit
Defines the maximum number of entries to return.
filter
By using ovrLeaderboard_FilterFriends, this allows you to filter the returned values to bidirectional followers.
startAt
Defines whether to center the query on the user or start at the top of the leaderboard.
Error codes
  • 100: Parameter {parameter}: invalid user id: {user_id}
  • 100: Something went wrong.
  • 12074: You're not yet ranked on this leaderboard.
A message with type ovrMessage_Leaderboard_GetEntries will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardEntryArrayHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardEntryArray().
ovrRequest ovr_Leaderboard_GetEntriesAfterRank
( const char * leaderboardName,
int limit,
unsigned long long afterRank )
Requests a block of leaderboard entries.
Parameters
leaderboardName
The name of the leaderboard.
limit
The maximum number of entries to return.
afterRank
The position after which to start. For example, 10 returns leaderboard results starting with the 11th user.
A message with type ovrMessage_Leaderboard_GetEntriesAfterRank will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardEntryArrayHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardEntryArray().
ovrRequest ovr_Leaderboard_GetEntriesByIds
( const char * leaderboardName,
int limit,
ovrID * userIDs,
unsigned int userIDLength )
Requests a block of leaderboard entries. Will return only entries matching the user IDs passed in.
Parameters
leaderboardName
The name of the leaderboard whose entries to return.
limit
Defines the maximum number of entries to return.
startAt
Defines whether to center the query on the user or start at the top of the leaderboard. If this is ovrLeaderboard_StartAtCenteredOnViewer or ovrLeaderboard_StartAtCenteredOnViewerOrTop, then the current user's ID will be automatically added to the query.
userIDs
Defines a list of user ids to get entries for.
userIDLength
The number of user IDs provided.
A message with type ovrMessage_Leaderboard_GetEntriesByIds will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardEntryArrayHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardEntryArray().
ovrRequest ovr_Leaderboard_GetNextEntries
Requests the next block of leaderboard entries.
Parameters
handle
A message with type ovrMessage_Leaderboard_GetNextEntries will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardEntryArrayHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardEntryArray().
ovrRequest ovr_Leaderboard_GetNextLeaderboardArrayPage
Get the next page of entries
A message with type ovrMessage_Leaderboard_GetNextLeaderboardArrayPage will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardArrayHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardArray().
ovrRequest ovr_Leaderboard_GetPreviousEntries
Requests the previous block of leaderboard entries.
Parameters
handle
A message with type ovrMessage_Leaderboard_GetPreviousEntries will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardEntryArrayHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardEntryArray().
ovrRequest ovr_Leaderboard_WriteEntry
( const char * leaderboardName,
long long score,
const void * extraData,
unsigned int extraDataLength,
bool forceUpdate )
Writes a single entry to a leaderboard.
Parameters
leaderboardName
The leaderboard for which to write the entry.
score
The score to write.
extraData
A 2KB custom data field that is associated with the leaderboard entry. This can be a game replay or anything that provides more detail about the entry to the viewer.
extraDataLength
The length of the extra data.
forceUpdate
If true, the score always updates. This happens even if it is not the user's best score.
Error codes
  • 100: Parameter {parameter}: invalid user id: {user_id}
  • 100: Something went wrong.
  • 100: This leaderboard entry is too late for the leaderboard's allowed time window.
A message with type ovrMessage_Leaderboard_WriteEntry will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardUpdateStatusHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardUpdateStatus().
ovrRequest ovr_Leaderboard_WriteEntryWithSupplementaryMetric
( const char * leaderboardName,
long long score,
long long supplementaryMetric,
const void * extraData,
unsigned int extraDataLength,
bool forceUpdate )
Writes a single entry to a leaderboard, can include supplementary metrics
Parameters
leaderboardName
The leaderboard for which to write the entry.
score
The score to write.
supplementaryMetric
A metric that can be used for tiebreakers.
extraData
A 2KB custom data field that is associated with the leaderboard entry. This can be a game replay or anything that provides more detail about the entry to the viewer.
extraDataLength
The length of the extra data.
forceUpdate
If true, the score always updates. This happens ecen if it is not the user's best score.
Error codes
  • 100: Parameter {parameter}: invalid user id: {user_id}
  • 100: Something went wrong.
  • 100: This leaderboard entry is too late for the leaderboard's allowed time window.
A message with type ovrMessage_Leaderboard_WriteEntryWithSupplementaryMetric will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrLeaderboardUpdateStatusHandle. Extract the payload from the message handle with ovr_Message_GetLeaderboardUpdateStatus().
Did you find this page helpful?
Thumbs up icon
Thumbs down icon