mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Refactored Achievement Mananger to load games through rc_client
HashGame has become LoadGame, similar structure with the file loaders but using the client instead. LoadGameCallback has been created to handle the results. The old LoadGameSync has been deleted as have several hash and load methods that it called.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -119,14 +119,9 @@ public:
|
||||
void SetUpdateCallback(UpdateCallback callback);
|
||||
void Login(const std::string& password);
|
||||
bool HasAPIToken() const;
|
||||
void HashGame(const std::string& file_path, const ResponseCallback& callback);
|
||||
void HashGame(const DiscIO::Volume* volume, const ResponseCallback& callback);
|
||||
void LoadGame(const std::string& file_path, const DiscIO::Volume* volume);
|
||||
bool IsGameLoaded() const;
|
||||
|
||||
void LoadUnlockData(const ResponseCallback& callback);
|
||||
void ActivateDeactivateAchievements();
|
||||
void ActivateDeactivateLeaderboards();
|
||||
void ActivateDeactivateRichPresence();
|
||||
void FetchBadges();
|
||||
|
||||
void DoFrame();
|
||||
@@ -173,11 +168,7 @@ private:
|
||||
|
||||
static void LoginCallback(int result, const char* error_message, rc_client_t* client,
|
||||
void* userdata);
|
||||
ResponseType ResolveHash(const Hash& game_hash, u32* game_id);
|
||||
void LoadGameSync(const ResponseCallback& callback);
|
||||
ResponseType StartRASession();
|
||||
ResponseType FetchGameData();
|
||||
ResponseType FetchUnlockData(bool hardcore);
|
||||
|
||||
ResponseType FetchBoardInfo(AchievementId leaderboard_id);
|
||||
|
||||
std::unique_ptr<DiscIO::Volume>& GetLoadingVolume() { return m_loading_volume; };
|
||||
@@ -189,6 +180,8 @@ private:
|
||||
ResponseType SubmitLeaderboard(AchievementId leaderboard_id, int value);
|
||||
ResponseType PingRichPresence(const RichPresence& rich_presence);
|
||||
|
||||
static void LoadGameCallback(int result, const char* error_message, rc_client_t* client,
|
||||
void* userdata);
|
||||
void DisplayWelcomeMessage();
|
||||
|
||||
void HandleAchievementTriggeredEvent(const rc_runtime_event_t* runtime_event);
|
||||
|
||||
@@ -576,8 +576,7 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
|
||||
}
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
AchievementManager::GetInstance().HashGame(executable.path,
|
||||
[](AchievementManager::ResponseType r_type) {});
|
||||
AchievementManager::GetInstance().LoadGame(executable.path, nullptr);
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
||||
if (!executable.reader->LoadIntoMemory(system))
|
||||
|
||||
@@ -399,8 +399,7 @@ void DVDInterface::SetDisc(std::unique_ptr<DiscIO::VolumeDisc> disc,
|
||||
}
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
AchievementManager::GetInstance().HashGame(disc.get(),
|
||||
[](AchievementManager::ResponseType r_type) {});
|
||||
AchievementManager::GetInstance().LoadGame("", disc.get());
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
||||
// Assume that inserting a disc requires having an empty disc before
|
||||
|
||||
@@ -268,19 +268,16 @@ void AchievementSettingsWidget::Logout()
|
||||
void AchievementSettingsWidget::ToggleAchievements()
|
||||
{
|
||||
SaveSettings();
|
||||
AchievementManager::GetInstance().ActivateDeactivateAchievements();
|
||||
}
|
||||
|
||||
void AchievementSettingsWidget::ToggleLeaderboards()
|
||||
{
|
||||
SaveSettings();
|
||||
AchievementManager::GetInstance().ActivateDeactivateLeaderboards();
|
||||
}
|
||||
|
||||
void AchievementSettingsWidget::ToggleRichPresence()
|
||||
{
|
||||
SaveSettings();
|
||||
AchievementManager::GetInstance().ActivateDeactivateRichPresence();
|
||||
}
|
||||
|
||||
void AchievementSettingsWidget::ToggleHardcore()
|
||||
@@ -311,13 +308,11 @@ void AchievementSettingsWidget::ToggleBadges()
|
||||
void AchievementSettingsWidget::ToggleUnofficial()
|
||||
{
|
||||
SaveSettings();
|
||||
AchievementManager::GetInstance().ActivateDeactivateAchievements();
|
||||
}
|
||||
|
||||
void AchievementSettingsWidget::ToggleEncore()
|
||||
{
|
||||
SaveSettings();
|
||||
AchievementManager::GetInstance().ActivateDeactivateAchievements();
|
||||
}
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
||||
Reference in New Issue
Block a user