Changeset - r28732:c64e085ed540
[Not reviewed]
master
0 4 0
Patric Stout - 3 months ago 2024-02-11 14:48:12
truebrain@openttd.org
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.
4 files changed with 3 insertions and 20 deletions:
0 comments (0 inline, 0 general)
src/network/network_content.cpp
Show inline comments
 
@@ -322,13 +322,13 @@ void ClientNetworkContentSocketHandler::
 

	
 
	/* If there's nothing to download, do nothing. */
 
	if (files == 0) return;
 

	
 
	this->isCancelled = false;
 

	
 
	if (_settings_client.network.no_http_content_downloads || fallback) {
 
	if (fallback) {
 
		this->DownloadSelectedContentFallback(content);
 
	} else {
 
		this->DownloadSelectedContentHTTP(content);
 
	}
 
}
 

	
src/settings.cpp
Show inline comments
 
@@ -155,13 +155,13 @@ public:
 
 */
 
enum IniFileVersion : uint32_t {
 
	IFV_0,                                                 ///< 0  All versions prior to introduction.
 
	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.
 
	IFV_REMOVE_GENERATION_SEED,                            ///< 7  PR#11927 Remove "generation_seed" from configuration.
 

	
 
	IFV_MAX_VERSION,       ///< Highest possible ini-file version.
 
@@ -1375,25 +1375,16 @@ void LoadFromConfig(bool startup)
 
	if (!startup) {
 
		if (generic_version < IFV_LINKGRAPH_SECONDS) {
 
			_settings_newgame.linkgraph.recalc_interval *= CalendarTime::SECONDS_PER_DAY;
 
			_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") {
 
						_settings_client.network.use_relay_service = UseRelayService::URS_NEVER;
 
					} else if (use_relay_service->value == "ask") {
 
						_settings_client.network.use_relay_service = UseRelayService::URS_ASK;
 
@@ -1493,13 +1484,12 @@ void SaveToConfig()
 
	}
 

	
 
	/* These variables are migrated from generic ini to private ini now. */
 
	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");
 
		}
 
	}
 

	
 
	HandleSettingDescs(generic_ini, private_ini, secrets_ini, IniSaveSettings, IniSaveSettingList);
 
	GraphicsSetSaveConfig(generic_ini);
src/settings_type.h
Show inline comments
 
@@ -327,13 +327,12 @@ struct NetworkSettings {
 
	uint8_t       max_clients;                              ///< maximum amount of clients
 
	TimerGameCalendar::Year restart_game_year;            ///< year the server restarts
 
	uint16_t      restart_hours;                          ///< number of hours to run the server before automatic restart
 
	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
 
};
 

	
 
/** Settings related to the creation of games. */
 
struct GameCreationSettings {
src/table/settings/network_private_settings.ini
Show inline comments
 
@@ -73,18 +73,12 @@ var      = network.last_joined
 
type     = SLE_STR
 
length   = 0
 
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
 
flags    = SF_GUI_DROPDOWN | SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
 
def      = URS_ASK
 
min      = URS_NO
0 comments (0 inline, 0 general)