GOG GALAXY SDK Documentation
|
The interface for managing statistics, achievements and leaderboards. More...
#include <IStats.h>
Public Member Functions | |
virtual void | RequestUserStatsAndAchievements (GalaxyID userID=GalaxyID(), IUserStatsAndAchievementsRetrieveListener *const listener=NULL)=0 |
Performs a request for statistics and achievements of a specified user. More... | |
virtual int32_t | GetStatInt (const char *name, GalaxyID userID=GalaxyID())=0 |
Reads integer value of a statistic of a specified user. More... | |
virtual float | GetStatFloat (const char *name, GalaxyID userID=GalaxyID())=0 |
Reads floating point value of a statistic of a specified user. More... | |
virtual void | SetStatInt (const char *name, int32_t value)=0 |
Updates a statistic with an integer value. More... | |
virtual void | SetStatFloat (const char *name, float value)=0 |
Updates a statistic with a floating point value. More... | |
virtual void | UpdateAvgRateStat (const char *name, float countThisSession, double sessionLength)=0 |
Updates an average-rate statistic with a delta. More... | |
virtual void | GetAchievement (const char *name, bool &unlocked, uint32_t &unlockTime, GalaxyID userID=GalaxyID())=0 |
Reads the state of an achievement of a specified user. More... | |
virtual void | SetAchievement (const char *name)=0 |
Unlocks an achievement. More... | |
virtual void | ClearAchievement (const char *name)=0 |
Clears an achievement. More... | |
virtual void | StoreStatsAndAchievements (IStatsAndAchievementsStoreListener *const listener=NULL)=0 |
Persists all changes in statistics and achievements. More... | |
virtual void | ResetStatsAndAchievements (IStatsAndAchievementsStoreListener *const listener=NULL)=0 |
Resets all statistics and achievements. More... | |
virtual const char * | GetAchievementDisplayName (const char *name)=0 |
Returns display name of a specified achievement. More... | |
virtual void | GetAchievementDisplayNameCopy (const char *name, char *buffer, uint32_t bufferLength)=0 |
Copies display name of a specified achievement. More... | |
virtual const char * | GetAchievementDescription (const char *name)=0 |
Returns description of a specified achievement. More... | |
virtual void | GetAchievementDescriptionCopy (const char *name, char *buffer, uint32_t bufferLength)=0 |
Copies description of a specified achievement. More... | |
virtual bool | IsAchievementVisible (const char *name)=0 |
Returns visibility status of a specified achievement. More... | |
virtual bool | IsAchievementVisibleWhileLocked (const char *name)=0 |
Returns visibility status of a specified achievement before unlocking. More... | |
virtual void | RequestLeaderboards (ILeaderboardsRetrieveListener *const listener=NULL)=0 |
Performs a request for definitions of leaderboards. More... | |
virtual const char * | GetLeaderboardDisplayName (const char *name)=0 |
Returns display name of a specified leaderboard. More... | |
virtual void | GetLeaderboardDisplayNameCopy (const char *name, char *buffer, uint32_t bufferLength)=0 |
Copies display name of a specified leaderboard. More... | |
virtual LeaderboardSortMethod | GetLeaderboardSortMethod (const char *name)=0 |
Returns sort method of a specified leaderboard. More... | |
virtual LeaderboardDisplayType | GetLeaderboardDisplayType (const char *name)=0 |
Returns display type of a specified leaderboard. More... | |
virtual void | RequestLeaderboardEntriesGlobal (const char *name, uint32_t rangeStart, uint32_t rangeEnd, ILeaderboardEntriesRetrieveListener *const listener=NULL)=0 |
Performs a request for entries of a specified leaderboard in a global scope, i.e. More... | |
virtual void | RequestLeaderboardEntriesAroundUser (const char *name, uint32_t countBefore, uint32_t countAfter, GalaxyID userID=GalaxyID(), ILeaderboardEntriesRetrieveListener *const listener=NULL)=0 |
Performs a request for entries of a specified leaderboard for and near the specified user. More... | |
virtual void | RequestLeaderboardEntriesForUsers (const char *name, GalaxyID *userArray, uint32_t userArraySize, ILeaderboardEntriesRetrieveListener *const listener=NULL)=0 |
Performs a request for entries of a specified leaderboard for specified users. More... | |
virtual void | GetRequestedLeaderboardEntry (uint32_t index, uint32_t &rank, int32_t &score, GalaxyID &userID)=0 |
Returns data from the currently processed request for leaderboard entries. More... | |
virtual void | GetRequestedLeaderboardEntryWithDetails (uint32_t index, uint32_t &rank, int32_t &score, void *details, uint32_t detailsSize, uint32_t &outDetailsSize, GalaxyID &userID)=0 |
Returns data with details from the currently processed request for leaderboard entries. More... | |
virtual void | SetLeaderboardScore (const char *name, int32_t score, bool forceUpdate=false, ILeaderboardScoreUpdateListener *const listener=NULL)=0 |
Updates entry for own user in a specified leaderboard. More... | |
virtual void | SetLeaderboardScoreWithDetails (const char *name, int32_t score, const void *details, uint32_t detailsSize, bool forceUpdate=false, ILeaderboardScoreUpdateListener *const listener=NULL)=0 |
Updates entry with details for own user in a specified leaderboard. More... | |
virtual uint32_t | GetLeaderboardEntryCount (const char *name)=0 |
Returns the leaderboard entry count for requested leaderboard. More... | |
virtual void | FindLeaderboard (const char *name, ILeaderboardRetrieveListener *const listener=NULL)=0 |
Performs a request for definition of a specified leaderboard. More... | |
virtual void | FindOrCreateLeaderboard (const char *name, const char *displayName, const LeaderboardSortMethod &sortMethod, const LeaderboardDisplayType &displayType, ILeaderboardRetrieveListener *const listener=NULL)=0 |
Performs a request for definition of a specified leaderboard, creating it if there is no such leaderboard yet. More... | |
virtual void | RequestUserTimePlayed (GalaxyID userID=GalaxyID(), IUserTimePlayedRetrieveListener *const listener=NULL)=0 |
Performs a request for user time played. More... | |
virtual uint32_t | GetUserTimePlayed (GalaxyID userID=GalaxyID())=0 |
Reads the number of seconds played by a specified user. More... | |
The interface for managing statistics, achievements and leaderboards.
|
pure virtual |
Clears an achievement.
[in] | name | The code name of the achievement. |
|
pure virtual |
Performs a request for definition of a specified leaderboard.
This call is asynchronous. Responses come to the ILeaderboardRetrieveListener.
[in] | name | The name of the leaderboard. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Performs a request for definition of a specified leaderboard, creating it if there is no such leaderboard yet.
This call is asynchronous. Responses come to the ILeaderboardRetrieveListener.
[in] | name | The name of the leaderboard. |
[in] | displayName | The display name of the leaderboard. |
[in] | sortMethod | The sort method of the leaderboard. |
[in] | displayType | The display method of the leaderboard. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Reads the state of an achievement of a specified user.
[in] | name | The code name of the achievement. |
[in,out] | unlocked | Indicates if the achievement has been unlocked. |
[out] | unlockTime | The time at which the achievement was unlocked. |
[in] | userID | The ID of the user. It can be omitted when requesting for own data. |
|
pure virtual |
Returns description of a specified achievement.
[in] | name | The name of the achievement. |
|
pure virtual |
Copies description of a specified achievement.
[in] | name | The name of the achievement. |
[in,out] | buffer | The output buffer. |
[in] | bufferLength | The size of the output buffer. |
|
pure virtual |
Returns display name of a specified achievement.
[in] | name | The name of the achievement. |
|
pure virtual |
Copies display name of a specified achievement.
[in] | name | The name of the achievement. |
[in,out] | buffer | The output buffer. |
[in] | bufferLength | The size of the output buffer. |
|
pure virtual |
Returns display name of a specified leaderboard.
[in] | name | The name of the leaderboard. |
|
pure virtual |
Copies display name of a specified leaderboard.
[in] | name | The name of the leaderboard. |
[in,out] | buffer | The output buffer. |
[in] | bufferLength | The size of the output buffer. |
|
pure virtual |
Returns display type of a specified leaderboard.
[in] | name | The name of the leaderboard. |
|
pure virtual |
Returns the leaderboard entry count for requested leaderboard.
[in] | name | The name of the leaderboard. |
|
pure virtual |
Returns sort method of a specified leaderboard.
[in] | name | The name of the leaderboard. |
|
pure virtual |
Returns data from the currently processed request for leaderboard entries.
Use this call to iterate over last retrieved leaderboard entries, indexed from 0.
[in] | index | Index as an integer in the range of [0, number of entries fetched). |
[out] | rank | User's rank in the leaderboard. |
[out] | score | User's score in the leaderboard. |
[out] | userID | The ID of the user. |
|
pure virtual |
Returns data with details from the currently processed request for leaderboard entries.
Use this call to iterate over last retrieved leaderboard entries, indexed from 0.
If the buffer that is supposed to take the details data is too small, the details will be truncated to its size.
[in] | index | Index as an integer in the range of [0, number of entries fetched). |
[out] | rank | User's rank in the leaderboard. |
[out] | score | User's score in the leaderboard. |
[in,out] | details | An extra, outgoing game-defined information regarding how the user got that score. |
[in] | detailsSize | The size of passed buffer of the extra game-defined information. |
[out] | outDetailsSize | The size of the extra game-defined information. |
[out] | userID | The ID of the user. |
Reads floating point value of a statistic of a specified user.
[in] | name | The code name of the statistic. |
[in] | userID | The ID of the user. It can be omitted when requesting for own data. |
Reads integer value of a statistic of a specified user.
[in] | name | The code name of the statistic. |
[in] | userID | The ID of the user. It can be omitted when requesting for own data. |
Reads the number of seconds played by a specified user.
[in] | userID | The ID of the user. It can be omitted when requesting for own data. |
|
pure virtual |
Returns visibility status of a specified achievement.
[in] | name | The name of the achievement. |
|
pure virtual |
Returns visibility status of a specified achievement before unlocking.
[in] | name | The name of the achievement. |
|
pure virtual |
Performs a request for entries of a specified leaderboard for and near the specified user.
The specified numbers of entries before and after the specified user are treated as hints. If the requested range would go beyond the set of all leaderboard entries, it is shifted so that it fits in the set of all leaderboard entries and preserves its size if possible.
This call is asynchronous. Responses come to the ILeaderboardEntriesRetrieveListener.
[in] | name | The name of the leaderboard. |
[in] | countBefore | The number of entries placed before the user's entry to retrieve (hint). |
[in] | countAfter | The number of entries placed after the user's entry to retrieve (hint). |
[in] | userID | The ID of the user. It can be omitted when requesting for own data. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Performs a request for entries of a specified leaderboard for specified users.
This call is asynchronous. Responses come to the ILeaderboardEntriesRetrieveListener.
[in] | name | The name of the leaderboard. |
[in] | userArray | An array with the list of IDs of the users in scope. |
[in] | userArraySize | The size of the array, i.e. the number of users in the specified list. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Performs a request for entries of a specified leaderboard in a global scope, i.e.
without any specific users in the scope of interest.
The entries are indexed by integers in the range of [0, number of entries).
This call is asynchronous. Responses come to the ILeaderboardEntriesRetrieveListener.
[in] | name | The name of the leaderboard. |
[in] | rangeStart | The index position of the entry to start with. |
[in] | rangeEnd | The index position of the entry to finish with. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Performs a request for definitions of leaderboards.
This call is asynchronous. Responses come to the ILeaderboardsRetrieveListener.
[in] | listener | The listener for specific operation. |
|
pure virtual |
Performs a request for statistics and achievements of a specified user.
This call is asynchronous. Responses come to the IUserStatsAndAchievementsRetrieveListener (for all GlobalUserStatsAndAchievementsRetrieveListener-derived and optional listener passed as argument).
[in] | userID | The ID of the user. It can be omitted when requesting for own data. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Performs a request for user time played.
This call is asynchronous. Responses come to the IUserTimePlayedRetrieveListener.
[in] | userID | The ID of the user. It can be omitted when requesting for own data. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Resets all statistics and achievements.
This is the same as setting statistics and achievements to their initial values and calling StoreStatsAndAchievements().
This call is asynchronous. Responses come to the IStatsAndAchievementsStoreListener (for all GlobalStatsAndAchievementsStoreListener-derived and optional listener passed as argument).
[in] | listener | The listener for specific operation. |
|
pure virtual |
Unlocks an achievement.
The achievement is marked as unlocked at the time at which this message was called.
[in] | name | The code name of the achievement. |
|
pure virtual |
Updates entry for own user in a specified leaderboard.
This call is asynchronous. Responses come to the ILeaderboardScoreUpdateListener.
[in] | name | The name of the leaderboard. |
[in] | score | The score to set. |
[in] | forceUpdate | If the update should be performed in case the score is worse than the previous score. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Updates entry with details for own user in a specified leaderboard.
This call is asynchronous. Responses come to the ILeaderboardScoreUpdateListener.
[in] | name | The name of the leaderboard. |
[in] | score | The score to set. |
[in] | details | An extra game-defined information regarding how the user got that score with the limit of 3071 bytes. |
[in] | detailsSize | The size of buffer of the extra game-defined information. |
[in] | forceUpdate | If the update should be performed in case the score is worse than the previous score. |
[in] | listener | The listener for specific operation. |
|
pure virtual |
Updates a statistic with a floating point value.
[in] | name | The code name of the statistic. |
[in] | value | The value of the statistic to set. |
|
pure virtual |
Updates a statistic with an integer value.
[in] | name | The code name of the statistic. |
[in] | value | The value of the statistic to set. |
|
pure virtual |
Persists all changes in statistics and achievements.
This call is asynchronous. Responses come to the IStatsAndAchievementsStoreListener (for all GlobalStatsAndAchievementsStoreListener-derived and optional listener passed as argument).
[in] | listener | The listener for specific operation. |
|
pure virtual |
Updates an average-rate statistic with a delta.
[in] | name | The code name of the statistic. |
[in] | countThisSession | The delta of the count. |
[in] | sessionLength | The delta of the session. |