diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index 6239563167..ff93120d7c 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -106,6 +106,17 @@ AchievementManager::ResponseType AchievementManager::StartRASession() return r_type; } +AchievementManager::ResponseType AchievementManager::FetchGameData() +{ + std::string username = Config::Get(Config::RA_USERNAME); + std::string api_token = Config::Get(Config::RA_API_TOKEN); + rc_api_fetch_game_data_request_t fetch_data_request = { + .username = username.c_str(), .api_token = api_token.c_str(), .game_id = m_game_id}; + return Request( + fetch_data_request, &m_game_data, rc_api_init_fetch_game_data_request, + rc_api_process_fetch_game_data_response); +} + // 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): // Create a specific rc_api_X_request_t struct and populate with the necessary values diff --git a/Source/Core/Core/AchievementManager.h b/Source/Core/Core/AchievementManager.h index c16c140670..7e39990fd3 100644 --- a/Source/Core/Core/AchievementManager.h +++ b/Source/Core/Core/AchievementManager.h @@ -44,6 +44,7 @@ private: ResponseType VerifyCredentials(const std::string& password); ResponseType ResolveHash(std::array game_hash); ResponseType StartRASession(); + ResponseType FetchGameData(); template ResponseType Request(RcRequest rc_request, RcResponse* rc_response, @@ -57,6 +58,8 @@ private: + rc_api_fetch_game_data_response_t m_game_data{}; + Common::WorkQueueThread> m_queue; }; // class AchievementManager