From 7a98df52976444f1ac2361223a68f8bcd3991f7a Mon Sep 17 00:00:00 2001 From: Wes Copeland Date: Sun, 16 Nov 2025 17:54:56 -0500 Subject: [PATCH] Achievements: support rc_client_set_host --- Core/Config.cpp | 1 + Core/Config.h | 1 + Core/RetroAchievements.cpp | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index b49d84d041..b4183f5f99 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -377,6 +377,7 @@ static const ConfigSetting achievementSettings[] = { // from the ini if manually entered (useful when testing various builds on Android). ConfigSetting("AchievementsToken", SETTING(g_Config, sAchievementsToken), "", CfgFlag::DONT_SAVE), ConfigSetting("AchievementsUserName", SETTING(g_Config, sAchievementsUserName), "", CfgFlag::DEFAULT), + ConfigSetting("AchievementsHost", SETTING(g_Config, sAchievementsHost), "", CfgFlag::DEFAULT), // Customizations ConfigSetting("AchievementsSoundEffects", SETTING(g_Config, bAchievementsSoundEffects), true, CfgFlag::DEFAULT), diff --git a/Core/Config.h b/Core/Config.h index 4d9ba1fffe..cc568ff735 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -642,6 +642,7 @@ public: // Still, we may wanna store it more securely than in PPSSPP.ini, especially on Android. std::string sAchievementsUserName; std::string sAchievementsToken; // Not saved, to be used if you want to manually make your RA login persistent. See Native_SaveSecret for the normal case. + std::string sAchievementsHost; // Optional custom host for debugging against alternate RA servers. // Various directories. Autoconfigured, not read from ini. Path currentDirectory; // The directory selected in the game browsing window. diff --git a/Core/RetroAchievements.cpp b/Core/RetroAchievements.cpp index cc64ffbdd6..7b74f45013 100644 --- a/Core/RetroAchievements.cpp +++ b/Core/RetroAchievements.cpp @@ -622,7 +622,10 @@ void Initialize() { // Provide a logging function to simplify debugging rc_client_enable_logging(g_rcClient, RC_CLIENT_LOG_LEVEL_VERBOSE, log_message_callback); - if (!System_GetPropertyBool(SYSPROP_SUPPORTS_HTTPS)) { + if (!g_Config.sAchievementsHost.empty()) { + // Custom host, only useful for debugging against non-prod RA environments. + rc_client_set_host(g_rcClient, g_Config.sAchievementsHost.c_str()); + } else if (!System_GetPropertyBool(SYSPROP_SUPPORTS_HTTPS)) { // Disable SSL if not supported by our platform implementation. rc_client_set_host(g_rcClient, "http://retroachievements.org"); }