Added HandleLeaderboardTriggeredEvent to AchievementManager
HandleLeaderboardTriggeredEvent processes a leaderboard event and asynchronizes via the work queue a synchronous call to SubmitLeaderboard.
This commit is contained in:
parent
637ca82fc1
commit
a48fab0abf
|
@ -429,6 +429,12 @@ void AchievementManager::HandleAchievementTriggeredEvent(const rc_runtime_event_
|
||||||
Config::Get(Config::RA_ENCORE_ENABLED));
|
Config::Get(Config::RA_ENCORE_ENABLED));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AchievementManager::HandleLeaderboardTriggeredEvent(const rc_runtime_event_t* runtime_event)
|
||||||
|
{
|
||||||
|
m_queue.EmplaceItem(
|
||||||
|
[this, runtime_event] { SubmitLeaderboard(runtime_event->id, runtime_event->value); });
|
||||||
|
}
|
||||||
|
|
||||||
// Every RetroAchievements API call, with only a partial exception for fetch_image, follows
|
// Every RetroAchievements API call, with only a partial exception for fetch_image, follows
|
||||||
// the same design pattern (here, X is the name of the call):
|
// the same design pattern (here, X is the name of the call):
|
||||||
// Create a specific rc_api_X_request_t struct and populate with the necessary values
|
// Create a specific rc_api_X_request_t struct and populate with the necessary values
|
||||||
|
|
|
@ -70,6 +70,7 @@ private:
|
||||||
ResponseType PingRichPresence(const RichPresence& rich_presence);
|
ResponseType PingRichPresence(const RichPresence& rich_presence);
|
||||||
|
|
||||||
void HandleAchievementTriggeredEvent(const rc_runtime_event_t* runtime_event);
|
void HandleAchievementTriggeredEvent(const rc_runtime_event_t* runtime_event);
|
||||||
|
void HandleLeaderboardTriggeredEvent(const rc_runtime_event_t* runtime_event);
|
||||||
|
|
||||||
template <typename RcRequest, typename RcResponse>
|
template <typename RcRequest, typename RcResponse>
|
||||||
ResponseType Request(RcRequest rc_request, RcResponse* rc_response,
|
ResponseType Request(RcRequest rc_request, RcResponse* rc_response,
|
||||||
|
|
Loading…
Reference in New Issue