From 4aab08c47bc5abef9bb447950e5ffc66a71a473f Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Mon, 3 Feb 2020 21:56:15 +0000 Subject: [PATCH] Set link timeout default to 500ms, fix prev. dflt. Default the linkTimeout ConfigManager variable to 500 (milliseconds.) Detect if the previous default is set, which 1, and set to 500, to repair existing configurations. This may reduce the amount of reports about link being broken, as some people have certainly not checked this setting, and the default should not be so wrong. Signed-off-by: Rafael Kitover --- src/common/ConfigManager.cpp | 10 ++++++++-- src/wx/opts.cpp | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/common/ConfigManager.cpp b/src/common/ConfigManager.cpp index 18879515..322ba952 100644 --- a/src/common/ConfigManager.cpp +++ b/src/common/ConfigManager.cpp @@ -193,7 +193,7 @@ int linkAuto; int linkHacks = 1; int linkMode; int linkNumPlayers; -int linkTimeout = 1; +int linkTimeout = 500; int maxScale; int mouseCounter = 0; int movieFrame; @@ -521,7 +521,13 @@ void LoadConfig() linkHostAddr = ReadPrefString("LinkHost", "localhost"); linkMode = ReadPref("LinkMode", 0); // LINK_DISCONNECTED = 0 linkNumPlayers = ReadPref("LinkNumPlayers", 2); - linkTimeout = ReadPref("LinkTimeout", 1); + + linkTimeout = ReadPref("LinkTimeout", 500); + + // Previous default was 1, which is very wrong. + if (linkTimeout <= 1) + linkTimeout = 500; + loadDotCodeFile = ReadPrefString("loadDotCodeFile"); maxScale = ReadPref("maxScale", 0); movieRecordDir = ReadPrefString("movieRecordDir"); diff --git a/src/wx/opts.cpp b/src/wx/opts.cpp index 4a1a3fd5..3b1bc51d 100644 --- a/src/wx/opts.cpp +++ b/src/wx/opts.cpp @@ -673,6 +673,10 @@ void load_opts() } } + // Make sure linkTimeout is not set to 1, which was the previous default. + if (linkTimeout <= 1) + linkTimeout = 500; + // recent is special // Recent does not get written with defaults cfg->SetPath(wxT("/Recent"));