diff options
author | rubidium42 <rubidium@openttd.org> | 2021-04-27 20:26:56 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-13 23:13:17 +0200 |
commit | c73d64adf984036a99d6974b130eda65dfc18c6c (patch) | |
tree | 05390f3269bf3279d51b290cde02cf17c395a626 /src/table | |
parent | f219354f891c45dcefad2dd0a2f1fd92b07e4ba5 (diff) | |
download | openttd-c73d64adf984036a99d6974b130eda65dfc18c6c.tar.xz |
Codechange: move passwords in settings to std::string
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/settings.h.preamble | 3 | ||||
-rw-r--r-- | src/table/settings.ini | 21 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/table/settings.h.preamble b/src/table/settings.h.preamble index c3e0678b7..09a89821a 100644 --- a/src/table/settings.h.preamble +++ b/src/table/settings.h.preamble @@ -129,6 +129,9 @@ static size_t ConvertLandscape(const char *value); #define SDTC_STR(var, type, flags, guiflags, def, str, strhelp, strval, proc, from, to, cat, extra, startup)\ SDTG_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, _settings_client.var, sizeof(_settings_client.var), def, 0, 0, 0, nullptr, str, strhelp, strval, proc, from, to, cat, extra, startup) +#define SDTC_SSTR(var, type, flags, guiflags, def, max_length, str, strhelp, strval, proc, from, to, cat, extra, startup)\ + SDTG_GENERAL(#var, SDT_STDSTRING, SL_STDSTR, type, flags, guiflags, _settings_client.var, sizeof(_settings_client.var), def, 0, max_length, 0, nullptr, str, strhelp, strval, proc, from, to, cat, extra, startup) + #define SDTC_OMANY(var, type, flags, guiflags, def, max, full, str, strhelp, strval, proc, from, to, cat, extra, startup)\ SDTG_GENERAL(#var, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, _settings_client.var, 1, def, 0, max, 0, full, str, strhelp, strval, proc, from, to, cat, extra, startup) diff --git a/src/table/settings.ini b/src/table/settings.ini index d12f58236..e8fa4560b 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -70,6 +70,7 @@ SDTC_BOOL = SDTC_BOOL( $var, $flags, $guiflags, $def, SDTC_LIST = SDTC_LIST( $var, $type, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup), SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $guiflags, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup), SDTC_STR = SDTC_STR( $var, $type, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup), +SDTC_SSTR = SDTC_SSTR( $var, $type, $flags, $guiflags, $def, $length, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup), SDTC_VAR = SDTC_VAR( $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup), SDT_BOOL = SDT_BOOL($base, $var, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup), SDT_OMANY = SDT_OMANY($base, $var, $type, $flags, $guiflags, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to, $load, $cat, $extra, $startup), @@ -3924,35 +3925,39 @@ def = nullptr proc = UpdateClientName cat = SC_BASIC -[SDTC_STR] +[SDTC_SSTR] var = network.server_password -type = SLE_STRB +type = SLE_STR +length = NETWORK_PASSWORD_LENGTH flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC guiflags = SGF_NETWORK_ONLY def = nullptr proc = UpdateServerPassword cat = SC_BASIC -[SDTC_STR] +[SDTC_SSTR] var = network.rcon_password -type = SLE_STRB +type = SLE_STR +length = NETWORK_PASSWORD_LENGTH flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC guiflags = SGF_NETWORK_ONLY def = nullptr proc = UpdateRconPassword cat = SC_BASIC -[SDTC_STR] +[SDTC_SSTR] var = network.admin_password -type = SLE_STRB +type = SLE_STR +length = NETWORK_PASSWORD_LENGTH flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC guiflags = SGF_NETWORK_ONLY def = nullptr cat = SC_BASIC -[SDTC_STR] +[SDTC_SSTR] var = network.default_company_pass -type = SLE_STRB +type = SLE_STR +length = NETWORK_PASSWORD_LENGTH flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC def = nullptr |