Handle Reset and Server Error client events.
This commit is contained in:
parent
b05028da1f
commit
3bf5b8e610
|
@ -776,6 +776,18 @@ void AchievementManager::HandleGameCompletedEvent(const rc_client_event_t* clien
|
|||
nullptr);
|
||||
}
|
||||
|
||||
void AchievementManager::HandleResetEvent(const rc_client_event_t* client_event)
|
||||
{
|
||||
INFO_LOG_FMT(ACHIEVEMENTS, "Reset requested by Achievement Mananger");
|
||||
Core::Stop(Core::System::GetInstance());
|
||||
}
|
||||
|
||||
void AchievementManager::HandleServerErrorEvent(const rc_client_event_t* client_event)
|
||||
{
|
||||
ERROR_LOG_FMT(ACHIEVEMENTS, "RetroAchievements server error: {} {}",
|
||||
client_event->server_error->api, client_event->server_error->error_message);
|
||||
}
|
||||
|
||||
static std::unique_ptr<OSD::Icon> DecodeBadgeToOSDIcon(const AchievementManager::Badge& badge)
|
||||
{
|
||||
if (badge.empty())
|
||||
|
@ -949,6 +961,12 @@ void AchievementManager::EventHandler(const rc_client_event_t* event, rc_client_
|
|||
case RC_CLIENT_EVENT_GAME_COMPLETED:
|
||||
HandleGameCompletedEvent(event, client);
|
||||
break;
|
||||
case RC_CLIENT_EVENT_RESET:
|
||||
HandleResetEvent(event);
|
||||
break;
|
||||
case RC_CLIENT_EVENT_SERVER_ERROR:
|
||||
HandleServerErrorEvent(event);
|
||||
break;
|
||||
default:
|
||||
INFO_LOG_FMT(ACHIEVEMENTS, "Event triggered of unhandled type {}", event->type);
|
||||
break;
|
||||
|
|
|
@ -169,6 +169,8 @@ private:
|
|||
static void HandleAchievementChallengeIndicatorHideEvent(const rc_client_event_t* client_event);
|
||||
static void HandleAchievementProgressIndicatorShowEvent(const rc_client_event_t* client_event);
|
||||
static void HandleGameCompletedEvent(const rc_client_event_t* client_event, rc_client_t* client);
|
||||
static void HandleResetEvent(const rc_client_event_t* client_event);
|
||||
static void HandleServerErrorEvent(const rc_client_event_t* client_event);
|
||||
|
||||
static void Request(const rc_api_request_t* request, rc_client_server_callback_t callback,
|
||||
void* callback_data, rc_client_t* client);
|
||||
|
|
Loading…
Reference in New Issue