add Util.GetFirstConfigVarFromSections<T>(..) While GetConfigVarFromSections<T> scans all sections and returns the last value found, this returns as soon a value is found. So sections should be order from high priority to lower

This commit is contained in:
UbitUmarov
2026-05-12 03:18:26 +01:00
parent 9db019b2cc
commit 88ef8a9dbe
3 changed files with 117 additions and 29 deletions

View File

@@ -100,18 +100,7 @@ namespace OpenSim.Region.ClientStack.Linden
IConfigSource config = m_Scene.Config;
if (config is not null)
{
IConfig sconfig = config.Configs["Startup"];
if (sconfig is not null)
ConfigOptions.levelUpload = sconfig.GetInt("LevelUpload", -9798);
if (ConfigOptions.levelUpload == -9798)
{
IConfig pconfig = config.Configs["Permissions"];
if (pconfig is not null)
ConfigOptions.levelUpload = pconfig.GetInt("LevelUpload", 0);
}
if (ConfigOptions.levelUpload == -9798)
ConfigOptions.levelUpload = 0;
ConfigOptions.levelUpload = Util.GetFirstConfigVarFromSections<int>(config,"LevelUpload",["Permissions", "Startup"], 0);
IConfig appearanceConfig = config.Configs["Appearance"];
if (appearanceConfig is not null)