GOG GALAXY SDK Documentation
ILeaderboardScoreUpdateListener Class Referenceabstract

Listener for the event of updating score in a leaderboard. More...

#include <IStats.h>

Inheritance diagram for ILeaderboardScoreUpdateListener:
[legend]

Public Types

enum  FailureReason { FAILURE_REASON_UNDEFINED , FAILURE_REASON_NO_IMPROVEMENT , FAILURE_REASON_CONNECTION_FAILURE }
 The reason of a failure in updating score in a leaderboard. More...
 

Public Member Functions

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. More...
 
virtual void OnLeaderboardScoreUpdateFailure (const char *name, int32_t score, FailureReason failureReason)=0
 The reason of a failure in updating score in a leaderboard. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GalaxyTypeAwareListener< LEADERBOARD_SCORE_UPDATE_LISTENER >
static ListenerType GetListenerType ()
 Returns the type of the listener. More...
 

Detailed Description

Listener for the event of updating score in a leaderboard.

Member Enumeration Documentation

◆ FailureReason

The reason of a failure in updating score in a leaderboard.

Enumerator
FAILURE_REASON_UNDEFINED 

Unspecified error.

FAILURE_REASON_NO_IMPROVEMENT 

Previous score was better and the update operation was not forced.

FAILURE_REASON_CONNECTION_FAILURE 

Unable to communicate with backend services.

Member Function Documentation

◆ OnLeaderboardScoreUpdateFailure()

virtual void OnLeaderboardScoreUpdateFailure ( const char *  name,
int32_t  score,
FailureReason  failureReason 
)
pure virtual

The reason of a failure in updating score in a leaderboard.

Parameters
[in]nameThe name of the leaderboard.
[in]scoreThe score that was attempted to set.
[in]failureReasonThe cause of the failure.

◆ OnLeaderboardScoreUpdateSuccess()

virtual void OnLeaderboardScoreUpdateSuccess ( const char *  name,
int32_t  score,
uint32_t  oldRank,
uint32_t  newRank 
)
pure virtual

Notification for the event of a success in setting score in a leaderboard.

Parameters
[in]nameThe name of the leaderboard.
[in]scoreThe score after the update.
[in]oldRankPrevious rank, i.e. before the update; 0 if the user had no entry yet.
[in]newRankCurrent rank, i.e. after the update.