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

OVR_Requests_Leaderboard.h File

Functions

Retrieves detailed information for a single leaderboard with a specified name, returning an array of ovrLeaderboardHandle.
Parameters
leaderboardName
The name of the leaderboard to retrieve.
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().
Retrieves a list of leaderboard entries for a specified leaderboardName, with options to filter and limit the number of results returned.
Parameters
leaderboardName
The name of the leaderboard from which to retrieve entries.
limit
Specifies the maximum number of entries to be returned.
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().
Retrieves a block of leaderboard entries starting from a specific rank.
Parameters
leaderboardName
The name of the leaderboard from which to retrieve entries.
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().
Retrieves a block of leaderboard entries that match the specified user IDs. Only entries corresponding to the provided user IDs will be returned.
Parameters
leaderboardName
The name of the leaderboard from which to retrieve entries.
limit
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().
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().
Get the next page of entries
Parameters
handle
The handle to the array to 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().
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().
Writes a single entry to the leaderboard, returning ovrLeaderboardUpdateStatusHandle indicating whether the update was successful and providing the updated challenge IDs.
Parameters
leaderboardName
The name of the leaderboard to which the entry should be written.
score
The score to be written in the leaderboard.
extraData
A 2KB custom data field that is associated with the leaderboard entry. This can be a game replay or any additional information that provides more context about the entry for 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().
Writes a single entry to a leaderboard which can include supplementary metrics, returning ovrLeaderboardUpdateStatusHandle indicating whether the update was successful and providing the updated challenge IDs.
Parameters
leaderboardName
The name of the leaderboard to which the entry should be written.
score
The score to be written in the leaderboard.
supplementaryMetric
Supplemental piece of data 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 any additional information that provides more context about the entry for 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_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