Add new type Settings & refactor TSettings behavior

into Settings by adding getters/setters

Signed-off-by: Lucca Jiménez Könings <development@jimkoen.com>
This commit is contained in:
Lucca Jiménez Könings
2024-02-18 19:21:07 +01:00
parent 4d7967d5d9
commit 55f5437618
4 changed files with 164 additions and 1 deletions
+5
View File
@@ -29,6 +29,7 @@
#include "TPluginMonitor.h"
#include "TResourceManager.h"
#include "TServer.h"
#include "TSettings.h"
#include <cstdint>
#include <iostream>
@@ -165,6 +166,10 @@ int BeamMPServerMain(MainArguments Arguments) {
SetupSignalHandlers();
Settings settings {};
settings.SettingsMap.emplace(Settings::Key::General_Name, Settings::SettingsTypeVariant { "Your mom" });
beammp_infof("Server name set in new impl: {}", settings.getAsString(Settings::Key::General_Name));
bool Shutdown = false;
Application::RegisterShutdownHandler([&Shutdown] {
beammp_info("If this takes too long, you can press Ctrl+C repeatedly to force a shutdown.");