1 #ifndef GALAXY_I_STATS_H
2 #define GALAXY_I_STATS_H
413 virtual void SetStatInt(
const char* name, int32_t value) = 0;
438 virtual void UpdateAvgRateStat(
const char* name,
float countThisSession,
double sessionLength) = 0;
674 uint32_t countBefore,
696 uint32_t userArraySize,
746 uint32_t detailsSize,
747 uint32_t& outDetailsSize,
770 bool forceUpdate =
false,
796 uint32_t detailsSize,
797 bool forceUpdate =
false,
840 const char* displayName,
Contains GalaxyID, which is the class that represents the ID of an entity used by Galaxy Peer.
Contains data structures and interfaces related to callback listeners.
Represents the ID of an entity used by Galaxy Peer.
Definition: GalaxyID.h:30
The class that is inherited by all specific callback listeners and provides a static method that retu...
Definition: IListenerRegistrar.h:117
Listener for the event of changing an achievement.
Definition: IStats.h:127
virtual void OnAchievementUnlocked(const char *name)=0
Notification for the event of storing changes that result in unlocking a particular achievement.
Listener for the event of retrieving requested entries of a leaderboard.
Definition: IStats.h:198
FailureReason
The reason of a failure in retrieving requested entries of a leaderboard.
Definition: IStats.h:215
@ FAILURE_REASON_NOT_FOUND
Could not find any entries for specified search criteria.
Definition: IStats.h:217
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStats.h:216
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStats.h:218
virtual void OnLeaderboardEntriesRetrieveFailure(const char *name, FailureReason failureReason)=0
Notification for the event of a failure in retrieving requested entries of a leaderboard.
virtual void OnLeaderboardEntriesRetrieveSuccess(const char *name, uint32_t entryCount)=0
Notification for the event of a success in retrieving requested entries of a leaderboard.
Listener for the event of retrieving definition of a leaderboard.
Definition: IStats.h:281
FailureReason
The reason of a failure in retrieving definition of a leaderboard.
Definition: IStats.h:301
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStats.h:302
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStats.h:303
virtual void OnLeaderboardRetrieveSuccess(const char *name)=0
Notification for the event of a success in retrieving definition of a leaderboard.
virtual void OnLeaderboardRetrieveFailure(const char *name, FailureReason failureReason)=0
Notification for the event of a failure in retrieving definition of a leaderboard.
Listener for the event of updating score in a leaderboard.
Definition: IStats.h:239
FailureReason
The reason of a failure in updating score in a leaderboard.
Definition: IStats.h:256
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStats.h:257
@ FAILURE_REASON_NO_IMPROVEMENT
Previous score was better and the update operation was not forced.
Definition: IStats.h:258
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStats.h:259
virtual void OnLeaderboardScoreUpdateSuccess(const char *name, int32_t score, uint32_t oldRank, uint32_t newRank)=0
Notification for the event of a success in setting score in a leaderboard.
virtual void OnLeaderboardScoreUpdateFailure(const char *name, int32_t score, FailureReason failureReason)=0
The reason of a failure in updating score in a leaderboard.
Listener for the event of retrieving definitions of leaderboards.
Definition: IStats.h:158
FailureReason
The reason of a failure in retrieving definitions of leaderboards.
Definition: IStats.h:176
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStats.h:177
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStats.h:178
virtual void OnLeaderboardsRetrieveFailure(FailureReason failureReason)=0
Notification for the event of a failure in retrieving definitions of leaderboards.
virtual void OnLeaderboardsRetrieveSuccess()=0
Notification for the event of a success in retrieving definitions of leaderboards.
Listener for the event of storing own statistics and achievements.
Definition: IStats.h:91
virtual void OnUserStatsAndAchievementsStoreFailure(FailureReason failureReason)=0
Notification for the event of a failure in storing statistics and achievements.
FailureReason
The reason of a failure in storing statistics and achievements.
Definition: IStats.h:104
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStats.h:105
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStats.h:106
virtual void OnUserStatsAndAchievementsStoreSuccess()=0
Notification for the event of success in storing statistics and achievements.
The interface for managing statistics, achievements and leaderboards.
Definition: IStats.h:363
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.
virtual void StoreStatsAndAchievements(IStatsAndAchievementsStoreListener *const listener=NULL)=0
Persists all changes in statistics and achievements.
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.
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 leaderb...
virtual LeaderboardSortMethod GetLeaderboardSortMethod(const char *name)=0
Returns sort method of a specified leaderboard.
virtual void RequestUserTimePlayed(GalaxyID userID=GalaxyID(), IUserTimePlayedRetrieveListener *const listener=NULL)=0
Performs a request for user time played.
virtual bool IsAchievementVisibleWhileLocked(const char *name)=0
Returns visibility status of a specified achievement before unlocking.
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.
virtual void GetAchievementDescriptionCopy(const char *name, char *buffer, uint32_t bufferLength)=0
Copies description of a specified achievement.
virtual void RequestUserStatsAndAchievements(GalaxyID userID=GalaxyID(), IUserStatsAndAchievementsRetrieveListener *const listener=NULL)=0
Performs a request for statistics and achievements of a specified user.
virtual float GetStatFloat(const char *name, GalaxyID userID=GalaxyID())=0
Reads floating point value of a statistic of a specified user.
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.
virtual int32_t GetStatInt(const char *name, GalaxyID userID=GalaxyID())=0
Reads integer value of a statistic of a specified user.
virtual LeaderboardDisplayType GetLeaderboardDisplayType(const char *name)=0
Returns display type of a specified leaderboard.
virtual void RequestLeaderboards(ILeaderboardsRetrieveListener *const listener=NULL)=0
Performs a request for definitions of leaderboards.
virtual const char * GetAchievementDescription(const char *name)=0
Returns description of a specified achievement.
virtual uint32_t GetLeaderboardEntryCount(const char *name)=0
Returns the leaderboard entry count for requested leaderboard.
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.
virtual void ResetStatsAndAchievements(IStatsAndAchievementsStoreListener *const listener=NULL)=0
Resets all statistics and achievements.
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.
virtual void SetAchievement(const char *name)=0
Unlocks an achievement.
virtual void SetStatFloat(const char *name, float value)=0
Updates a statistic with a floating point value.
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.
virtual uint32_t GetUserTimePlayed(GalaxyID userID=GalaxyID())=0
Reads the number of seconds played by a specified user.
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.
virtual void UpdateAvgRateStat(const char *name, float countThisSession, double sessionLength)=0
Updates an average-rate statistic with a delta.
virtual bool IsAchievementVisible(const char *name)=0
Returns visibility status of a specified achievement.
virtual void FindLeaderboard(const char *name, ILeaderboardRetrieveListener *const listener=NULL)=0
Performs a request for definition of a specified leaderboard.
virtual void ClearAchievement(const char *name)=0
Clears an achievement.
virtual void SetStatInt(const char *name, int32_t value)=0
Updates a statistic with an integer value.
virtual const char * GetLeaderboardDisplayName(const char *name)=0
Returns display name of a specified leaderboard.
virtual void GetAchievementDisplayNameCopy(const char *name, char *buffer, uint32_t bufferLength)=0
Copies display name of a specified achievement.
virtual void GetLeaderboardDisplayNameCopy(const char *name, char *buffer, uint32_t bufferLength)=0
Copies display name of a specified leaderboard.
virtual const char * GetAchievementDisplayName(const char *name)=0
Returns display name of a specified achievement.
Listener for the event of retrieving statistics and achievements of a specified user,...
Definition: IStats.h:47
FailureReason
The reason of a failure in retrieving statistics and achievements.
Definition: IStats.h:67
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStats.h:68
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStats.h:69
virtual void OnUserStatsAndAchievementsRetrieveFailure(GalaxyID userID, FailureReason failureReason)=0
Notification for the event of a failure in retrieving statistics and achievements for a specified use...
virtual void OnUserStatsAndAchievementsRetrieveSuccess(GalaxyID userID)=0
Notification for the event of success in retrieving statistics and achievements for a specified user.
Listener for the event of retrieving user time played.
Definition: IStats.h:324
FailureReason
The reason of a failure in retrieving user time played.
Definition: IStats.h:340
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: IStats.h:341
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: IStats.h:342
virtual void OnUserTimePlayedRetrieveSuccess(GalaxyID userID)=0
Notification for the event of a success in retrieving user time played.
virtual void OnUserTimePlayedRetrieveFailure(GalaxyID userID, FailureReason failureReason)=0
Notification for the event of a failure in retrieving user time played.
The class that is inherited by the self-registering versions of all specific callback listeners.
Definition: IListenerRegistrar.h:211
SelfRegisteringListener< ILeaderboardsRetrieveListener > GlobalLeaderboardsRetrieveListener
Globally self-registering version of a ILeaderboardsRetrieveListener.
Definition: IStats.h:192
SelfRegisteringListener< ILeaderboardScoreUpdateListener > GlobalLeaderboardScoreUpdateListener
Globally self-registering version of a ILeaderboardScoreUpdateListener.
Definition: IStats.h:275
SelfRegisteringListener< ILeaderboardRetrieveListener > GlobalLeaderboardRetrieveListener
Globally self-registering version of a ILeaderboardRetrieveListener.
Definition: IStats.h:318
LeaderboardSortMethod
The sort order of a leaderboard.
Definition: IStats.h:25
SelfRegisteringListener< ILeaderboardEntriesRetrieveListener > GlobalLeaderboardEntriesRetrieveListener
Globally self-registering version of a ILeaderboardEntriesRetrieveListener.
Definition: IStats.h:233
SelfRegisteringListener< IStatsAndAchievementsStoreListener > GlobalStatsAndAchievementsStoreListener
Globally self-registering version of IStatsAndAchievementsStoreListener.
Definition: IStats.h:121
LeaderboardDisplayType
The display type of a leaderboard.
Definition: IStats.h:35
SelfRegisteringListener< IUserStatsAndAchievementsRetrieveListener > GlobalUserStatsAndAchievementsRetrieveListener
Globally self-registering version of IUserStatsAndAchievementsRetrieveListener.
Definition: IStats.h:85
SelfRegisteringListener< IUserTimePlayedRetrieveListener > GlobalUserTimePlayedRetrieveListener
Globally self-registering version of a IUserTimePlayedRetrieveListener.
Definition: IStats.h:357
SelfRegisteringListener< IAchievementChangeListener > GlobalAchievementChangeListener
Globally self-registering version of IAchievementChangeListener.
Definition: IStats.h:152
@ LEADERBOARD_SORT_METHOD_NONE
No sorting method specified.
Definition: IStats.h:26
@ LEADERBOARD_SORT_METHOD_DESCENDING
Top score is highest number.
Definition: IStats.h:28
@ LEADERBOARD_SORT_METHOD_ASCENDING
Top score is lowest number.
Definition: IStats.h:27
@ LEADERBOARD_DISPLAY_TYPE_NUMBER
Simple numerical score.
Definition: IStats.h:37
@ LEADERBOARD_DISPLAY_TYPE_TIME_SECONDS
The score represents time, in seconds.
Definition: IStats.h:38
@ LEADERBOARD_DISPLAY_TYPE_NONE
Not display type specified.
Definition: IStats.h:36
@ LEADERBOARD_DISPLAY_TYPE_TIME_MILLISECONDS
The score represents time, in milliseconds.
Definition: IStats.h:39