From 9c3042280d662f5449ae9bbfe8e64f89519fb705 Mon Sep 17 00:00:00 2001 From: pedrotski <58076186+pedrotski@users.noreply.github.com> Date: Sun, 19 Jan 2025 00:32:20 +0800 Subject: [PATCH 1/2] Update TConfig.cpp Add ENV for missing settings. Issue: https://github.com/BeamMP/BeamMP-Server/issues/414 Please let me know if there are any issues. --- src/TConfig.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TConfig.cpp b/src/TConfig.cpp index 74e28468..99313248 100644 --- a/src/TConfig.cpp +++ b/src/TConfig.cpp @@ -62,7 +62,9 @@ static constexpr std::string_view StrPassword = "Password"; // Misc static constexpr std::string_view StrHideUpdateMessages = "ImScaredOfUpdates"; +static constexpr std::string_view EnvStrHideUpdateMessages = "BEAMMP_HIDE_UPDATE_MESSAGES"; static constexpr std::string_view StrUpdateReminderTime = "UpdateReminderTime"; +static constexpr std::string_view EnvStrUpdateReminderTime = "BEAMMP_UPDATE_REMINDER_TIME"; TEST_CASE("TConfig::TConfig") { const std::string CfgFile = "beammp_server_testconfig.toml"; @@ -263,8 +265,8 @@ void TConfig::ParseFromFile(std::string_view name) { TryReadValue(data, "General", StrLogChat, EnvStrLogChat, Settings::Key::General_LogChat); TryReadValue(data, "General", StrAllowGuests, EnvStrAllowGuests, Settings::Key::General_AllowGuests); // Misc - TryReadValue(data, "Misc", StrHideUpdateMessages, "", Settings::Key::Misc_ImScaredOfUpdates); - TryReadValue(data, "Misc", StrUpdateReminderTime, "", Settings::Key::Misc_UpdateReminderTime); + TryReadValue(data, "Misc", StrHideUpdateMessages, EnvStrHideUpdateMessages, Settings::Key::Misc_ImScaredOfUpdates); + TryReadValue(data, "Misc", StrUpdateReminderTime, EnvStrUpdateReminderTime, Settings::Key::Misc_UpdateReminderTime); } catch (const std::exception& err) { beammp_error("Error parsing config file value: " + std::string(err.what())); From 840f9b9f9dd9b96f49aed764bfd1ea4323e42e3a Mon Sep 17 00:00:00 2001 From: pedrotski <58076186+pedrotski@users.noreply.github.com> Date: Sun, 19 Jan 2025 06:59:35 +0800 Subject: [PATCH 2/2] Update src/TConfig.cpp Co-authored-by: Tixx <83774803+WiserTixx@users.noreply.github.com> --- src/TConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TConfig.cpp b/src/TConfig.cpp index 99313248..0c902a86 100644 --- a/src/TConfig.cpp +++ b/src/TConfig.cpp @@ -62,7 +62,7 @@ static constexpr std::string_view StrPassword = "Password"; // Misc static constexpr std::string_view StrHideUpdateMessages = "ImScaredOfUpdates"; -static constexpr std::string_view EnvStrHideUpdateMessages = "BEAMMP_HIDE_UPDATE_MESSAGES"; +static constexpr std::string_view EnvStrHideUpdateMessages = "BEAMMP_IM_SCARED_OF_UPDATES"; static constexpr std::string_view StrUpdateReminderTime = "UpdateReminderTime"; static constexpr std::string_view EnvStrUpdateReminderTime = "BEAMMP_UPDATE_REMINDER_TIME";