diff options
| -rw-r--r-- | zenserver/config.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/zenserver/config.cpp b/zenserver/config.cpp index c33fcfebc..722bc3b97 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -561,5 +561,24 @@ ParseConfigFile(const std::filesystem::path& Path, ZenServerOptions& ServerOptio } } } + + if (sol::optional<sol::table> GcConfig = lua["gc"]) + { + ServerOptions.GcConfig.IntervalSeconds = GcConfig.value().get_or("intervalseconds", 0); + + if (sol::optional<sol::table> CacheGcConfig = GcConfig.value()["cache"]) + { + ServerOptions.GcConfig.Cache.MaxDurationSeconds = CacheGcConfig.value().get_or("maxdurationseconds", int32_t(0)); + ServerOptions.GcConfig.Cache.DiskSizeLimit = CacheGcConfig.value().get_or("disksizelimit", ~uint64_t(0)); + ServerOptions.GcConfig.Cache.MemorySizeLimit = CacheGcConfig.value().get_or("memorysizelimit", ~uint64_t(0)); + } + + if (sol::optional<sol::table> CasGcConfig = GcConfig.value()["cas"]) + { + ServerOptions.GcConfig.Cas.LargeStrategySizeLimit = CasGcConfig.value().get_or("largestrategysizelimit", ~uint64_t(0)); + ServerOptions.GcConfig.Cas.SmallStrategySizeLimit = CasGcConfig.value().get_or("smallstrategysizelimit", ~uint64_t(0)); + ServerOptions.GcConfig.Cas.TinyStrategySizeLimit = CasGcConfig.value().get_or("tinystrategysizelimit", ~uint64_t(0)); + } + } } } |