add cheevos_custom_host setting (#13284)

This commit is contained in:
Jamiras 2021-11-24 23:15:19 -07:00 committed by GitHub
parent 5069acd288
commit 339feab15b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -591,8 +591,25 @@ static bool rcheevos_async_succeeded(int result,
void rcheevos_client_initialize(void)
{
/* force non-HTTPS until everything uses RAPI */
rc_api_set_host("http://retroachievements.org");
const settings_t* settings = config_get_ptr();
const char* host = settings->arrays.cheevos_custom_host;
if (!host[0])
{
#ifdef HAVE_SSL
host = "https://retroachievements.org";
#else
host = "http://retroachievements.org";
#endif
}
CHEEVOS_LOG(RCHEEVOS_TAG "Using host: %s\n", host);
if (!string_is_equal(host, "https://retroachievements.org"))
{
rc_api_set_host(host);
if (!string_is_equal(host, "http://retroachievements.org"))
rc_api_set_image_host(host);
}
}
/****************************

View file

@ -1394,6 +1394,7 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
SETTING_ARRAY("audio_device", settings->arrays.audio_device, false, NULL, true);
SETTING_ARRAY("camera_device", settings->arrays.camera_device, false, NULL, true);
#ifdef HAVE_CHEEVOS
SETTING_ARRAY("cheevos_custom_host", settings->arrays.cheevos_custom_host, false, NULL, true);
SETTING_ARRAY("cheevos_username", settings->arrays.cheevos_username, false, NULL, true);
SETTING_ARRAY("cheevos_password", settings->arrays.cheevos_password, false, NULL, true);
SETTING_ARRAY("cheevos_token", settings->arrays.cheevos_token, false, NULL, true);

View file

@ -409,6 +409,7 @@ typedef struct settings
char cheevos_password[256];
char cheevos_token[32];
char cheevos_leaderboards_enable[32];
char cheevos_custom_host[64];
char video_context_driver[32];
char audio_driver[32];
char audio_resampler[32];