Fix: no_http_content_downloads and use_relay_service as private settings (#10762)

Basically, we don't need to know those values when people send in
crash reports.
This commit is contained in:
Patric Stout
2023-05-04 22:46:02 +02:00
committed by GitHub
parent 8d501f2db1
commit c6c3d0e6fa
3 changed files with 63 additions and 25 deletions

View File

@@ -7,13 +7,19 @@
; Network settings as stored in the private configuration file ("private.cfg").
[pre-amble]
static constexpr std::initializer_list<const char*> _use_relay_service{"never", "ask", "allow"};
static const SettingVariant _network_private_settings_table[] = {
[post-amble]
};
[templates]
SDTC_SSTR = SDTC_SSTR( $var, $type, $flags, $def, $length, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
SDTC_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
[defaults]
flags = SF_NONE
@@ -66,3 +72,22 @@ 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
max = URS_ALLOW
full = _use_relay_service
str = STR_CONFIG_SETTING_USE_RELAY_SERVICE
strhelp = STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT
strval = STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER
cat = SC_BASIC

View File

@@ -10,7 +10,6 @@
static void UpdateClientConfigValues();
static constexpr std::initializer_list<const char*> _server_game_type{"local", "public", "invite-only"};
static constexpr std::initializer_list<const char*> _use_relay_service{"never", "ask", "allow"};
static const SettingVariant _network_settings_table[] = {
[post-amble]
@@ -246,22 +245,3 @@ var = network.reload_cfg
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_NETWORK_ONLY
def = false
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
max = URS_ALLOW
full = _use_relay_service
str = STR_CONFIG_SETTING_USE_RELAY_SERVICE
strhelp = STR_CONFIG_SETTING_USE_RELAY_SERVICE_HELPTEXT
strval = STR_CONFIG_SETTING_USE_RELAY_SERVICE_NEVER
cat = SC_BASIC