generate toml from scratch

This commit is contained in:
Lion Kortlepel
2022-07-09 22:42:38 +02:00
parent 6c1d02a425
commit f8d622352f

View File

@@ -62,7 +62,8 @@ void SetComment(CommentsT& Comments, const std::string& Comment) {
* whether it is in TConfig.cpp or the configuration file. * whether it is in TConfig.cpp or the configuration file.
*/ */
void TConfig::FlushToFile() { void TConfig::FlushToFile() {
auto data = toml::parse<toml::preserve_comments>(mConfigFileName); // auto data = toml::parse<toml::preserve_comments>(mConfigFileName);
auto data = toml::value {};
data["General"][StrAuthKey.data()] = Application::Settings.Key; data["General"][StrAuthKey.data()] = Application::Settings.Key;
SetComment(data["General"][StrAuthKey.data()].comments(), " AuthKey has to be filled out in order to run the server"); SetComment(data["General"][StrAuthKey.data()].comments(), " AuthKey has to be filled out in order to run the server");
data["General"][StrDebug.data()] = Application::Settings.DebugModeEnabled; data["General"][StrDebug.data()] = Application::Settings.DebugModeEnabled;