mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 14:56:04 +00:00
change settings to be a hash map instead of a fixed struct
this makes adding settings and changing settings incredibly easy, both from the console and from lua.
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
TLuaEngine* LuaAPI::MP::Engine;
|
||||
|
||||
TLuaEngine::TLuaEngine()
|
||||
: mResourceServerPath(fs::path(Application::Settings.Resource) / "Server") {
|
||||
: mResourceServerPath(fs::path(Application::GetSettingString(StrResourceFolder)) / "Server") {
|
||||
Application::SetSubsystemStatus("LuaEngine", Application::Status::Starting);
|
||||
LuaAPI::MP::Engine = this;
|
||||
if (!fs::exists(Application::Settings.Resource)) {
|
||||
fs::create_directory(Application::Settings.Resource);
|
||||
if (!fs::exists(Application::GetSettingString(StrResourceFolder))) {
|
||||
fs::create_directory(Application::GetSettingString(StrResourceFolder));
|
||||
}
|
||||
if (!fs::exists(mResourceServerPath)) {
|
||||
fs::create_directory(mResourceServerPath);
|
||||
@@ -36,7 +36,7 @@ TLuaEngine::TLuaEngine()
|
||||
}
|
||||
|
||||
TEST_CASE("TLuaEngine ctor & dtor") {
|
||||
Application::Settings.Resource = "beammp_server_test_resources";
|
||||
Application::SetSetting(StrResourceFolder, "beammp_server_test_resources");
|
||||
TLuaEngine engine;
|
||||
Application::GracefullyShutdown();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user