From d02b1547f671b982d36189abe207da4852c6159d Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 11 Feb 2024 15:48:12 +0100 Subject: [PATCH] Remove: setting "no_http_content_downloads" (#12058) As we now use HTTPS, it is very likely this will work on most systems. For systems that do have HTTPS blocked, it will fail instantly, and it will fallback to TCP anyway. That makes this setting no longer very useful. --- src/network/network_content.cpp | 2 +- src/settings.cpp | 14 ++------------ src/settings_type.h | 1 - src/table/settings/network_private_settings.ini | 6 ------ 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 20a73af1a4..638c8860f8 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -325,7 +325,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin this->isCancelled = false; - if (_settings_client.network.no_http_content_downloads || fallback) { + if (fallback) { this->DownloadSelectedContentFallback(content); } else { this->DownloadSelectedContentHTTP(content); diff --git a/src/settings.cpp b/src/settings.cpp index e2e3116531..5200b2394c 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -158,7 +158,7 @@ enum IniFileVersion : uint32_t { IFV_PRIVATE_SECRETS, ///< 1 PR#9298 Moving of settings from openttd.cfg to private.cfg / secrets.cfg. IFV_GAME_TYPE, ///< 2 PR#9515 Convert server_advertise to server_game_type. IFV_LINKGRAPH_SECONDS, ///< 3 PR#10610 Store linkgraph update intervals in seconds instead of days. - IFV_NETWORK_PRIVATE_SETTINGS, ///< 4 PR#10762 Move no_http_content_downloads / use_relay_service to private settings. + IFV_NETWORK_PRIVATE_SETTINGS, ///< 4 PR#10762 Move use_relay_service to private settings. IFV_AUTOSAVE_RENAME, ///< 5 PR#11143 Renamed values of autosave to be in minutes. IFV_RIGHT_CLICK_CLOSE, ///< 6 PR#10204 Add alternative right click to close windows setting. @@ -1378,19 +1378,10 @@ void LoadFromConfig(bool startup) _settings_newgame.linkgraph.recalc_time *= CalendarTime::SECONDS_PER_DAY; } - /* Move no_http_content_downloads and use_relay_service from generic_ini to private_ini. */ + /* Move use_relay_service from generic_ini to private_ini. */ if (generic_version < IFV_NETWORK_PRIVATE_SETTINGS) { const IniGroup *network = generic_ini.GetGroup("network"); if (network != nullptr) { - const IniItem *no_http_content_downloads = network->GetItem("no_http_content_downloads"); - if (no_http_content_downloads != nullptr) { - if (no_http_content_downloads->value == "true") { - _settings_client.network.no_http_content_downloads = true; - } else if (no_http_content_downloads->value == "false") { - _settings_client.network.no_http_content_downloads = false; - } - } - const IniItem *use_relay_service = network->GetItem("use_relay_service"); if (use_relay_service != nullptr) { if (use_relay_service->value == "never") { @@ -1496,7 +1487,6 @@ void SaveToConfig() if (generic_version < IFV_NETWORK_PRIVATE_SETTINGS) { IniGroup *network = generic_ini.GetGroup("network"); if (network != nullptr) { - network->RemoveItem("no_http_content_downloads"); network->RemoveItem("use_relay_service"); } } diff --git a/src/settings_type.h b/src/settings_type.h index 45bf4560b0..3d16ceae47 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -330,7 +330,6 @@ struct NetworkSettings { uint8_t min_active_clients; ///< minimum amount of active clients to unpause the game bool reload_cfg; ///< reload the config file before restarting std::string last_joined; ///< Last joined server - bool no_http_content_downloads; ///< do not do content downloads over HTTP UseRelayService use_relay_service; ///< Use relay service? ParticipateSurvey participate_survey; ///< Participate in the automated survey }; diff --git a/src/table/settings/network_private_settings.ini b/src/table/settings/network_private_settings.ini index 4797643556..967dfb2054 100644 --- a/src/table/settings/network_private_settings.ini +++ b/src/table/settings/network_private_settings.ini @@ -76,12 +76,6 @@ flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC def = """" cat = SC_EXPERT -[SDTC_BOOL] -var = network.no_http_content_downloads -flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC -def = false -cat = SC_EXPERT - [SDTC_OMANY] var = network.use_relay_service type = SLE_UINT8