Common handler for saving/loading variables to the configuration file */
| 1263 | |
| 1264 | /* Common handler for saving/loading variables to the configuration file */ |
| 1265 | static void HandleSettingDescs(IniFile &generic_ini, IniFile &private_ini, IniFile &secrets_ini, SettingDescProc *proc, SettingDescProcList *proc_list, bool only_startup = false) |
| 1266 | { |
| 1267 | proc(generic_ini, _misc_settings, "misc", nullptr, only_startup); |
| 1268 | #if defined(_WIN32) && !defined(DEDICATED) |
| 1269 | proc(generic_ini, _win32_settings, "win32", nullptr, only_startup); |
| 1270 | #endif /* _WIN32 */ |
| 1271 | |
| 1272 | /* The name "patches" is a fallback, as every setting should sets its own group. */ |
| 1273 | |
| 1274 | for (auto &table : GenericSettingTables()) { |
| 1275 | proc(generic_ini, table, "patches", &_settings_newgame, only_startup); |
| 1276 | } |
| 1277 | for (auto &table : PrivateSettingTables()) { |
| 1278 | proc(private_ini, table, "patches", &_settings_newgame, only_startup); |
| 1279 | } |
| 1280 | for (auto &table : SecretSettingTables()) { |
| 1281 | proc(secrets_ini, table, "patches", &_settings_newgame, only_startup); |
| 1282 | } |
| 1283 | |
| 1284 | proc(generic_ini, _currency_settings, "currency", &GetCustomCurrency(), only_startup); |
| 1285 | proc(generic_ini, _company_settings, "company", &_settings_client.company, only_startup); |
| 1286 | |
| 1287 | if (!only_startup) { |
| 1288 | proc_list(private_ini, "server_bind_addresses", _network_bind_list); |
| 1289 | proc_list(private_ini, "servers", _network_host_list); |
| 1290 | proc_list(private_ini, "bans", _network_ban_list); |
| 1291 | proc_list(private_ini, "server_authorized_keys", _settings_client.network.server_authorized_keys); |
| 1292 | proc_list(private_ini, "rcon_authorized_keys", _settings_client.network.rcon_authorized_keys); |
| 1293 | proc_list(private_ini, "admin_authorized_keys", _settings_client.network.admin_authorized_keys); |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | /** |
| 1298 | * Remove all entries from a settings table from an ini-file. |
no outgoing calls
no test coverage detected