From c889eb64e55b973211fe2024ab627bec2f740e48 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 2 Feb 2018 03:50:43 +0000 Subject: let ossl have its own config section --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 38ecd57..e156582 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -144,6 +144,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal bool m_debuggerSafe = false; internal Dictionary m_FunctionPerms = new Dictionary(); protected IUrlModule m_UrlModule = null; + internal IConfig m_osslconfig; public void Initialize( IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) @@ -151,11 +152,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_ScriptEngine = scriptEngine; m_host = host; m_item = item; + + m_osslconfig = m_ScriptEngine.ConfigSource.Configs["OSSL"]; + if(m_osslconfig == null) + m_osslconfig = m_ScriptEngine.Config; + m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false); m_UrlModule = m_ScriptEngine.World.RequestModuleInterface(); - - if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false)) + if (m_osslconfig.GetBoolean("AllowOSFunctions", false)) { m_OSFunctionsEnabled = true; // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); @@ -166,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_ScriptDistanceFactor = m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); - string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow"); + string risk = m_osslconfig.GetString("OSFunctionThreatLevel", "VeryLow"); switch (risk) { case "NoAccess": @@ -292,8 +297,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api FunctionPerms perms = new FunctionPerms(); m_FunctionPerms[function] = perms; - string ownerPerm = m_ScriptEngine.Config.GetString("Allow_" + function, ""); - string creatorPerm = m_ScriptEngine.Config.GetString("Creators_" + function, ""); + string ownerPerm = m_osslconfig.GetString("Allow_" + function, ""); + string creatorPerm = m_osslconfig.GetString("Creators_" + function, ""); if (ownerPerm == "" && creatorPerm == "") { // Default behavior -- cgit v1.1