aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2018-02-02 03:50:43 +0000
committerUbitUmarov2018-02-02 03:50:43 +0000
commitc889eb64e55b973211fe2024ab627bec2f740e48 (patch)
tree130cb87ef98e8d6d48587c91b82423e79b056ae9 /OpenSim
parentremove a duplicated field (diff)
downloadopensim-SC-c889eb64e55b973211fe2024ab627bec2f740e48.zip
opensim-SC-c889eb64e55b973211fe2024ab627bec2f740e48.tar.gz
opensim-SC-c889eb64e55b973211fe2024ab627bec2f740e48.tar.bz2
opensim-SC-c889eb64e55b973211fe2024ab627bec2f740e48.tar.xz
let ossl have its own config section
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs15
1 files changed, 10 insertions, 5 deletions
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
144 internal bool m_debuggerSafe = false; 144 internal bool m_debuggerSafe = false;
145 internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); 145 internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
146 protected IUrlModule m_UrlModule = null; 146 protected IUrlModule m_UrlModule = null;
147 internal IConfig m_osslconfig;
147 148
148 public void Initialize( 149 public void Initialize(
149 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item) 150 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item)
@@ -151,11 +152,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
151 m_ScriptEngine = scriptEngine; 152 m_ScriptEngine = scriptEngine;
152 m_host = host; 153 m_host = host;
153 m_item = item; 154 m_item = item;
155
156 m_osslconfig = m_ScriptEngine.ConfigSource.Configs["OSSL"];
157 if(m_osslconfig == null)
158 m_osslconfig = m_ScriptEngine.Config;
159
154 m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false); 160 m_debuggerSafe = m_ScriptEngine.Config.GetBoolean("DebuggerSafe", false);
155 161
156 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); 162 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
157 163 if (m_osslconfig.GetBoolean("AllowOSFunctions", false))
158 if (m_ScriptEngine.Config.GetBoolean("AllowOSFunctions", false))
159 { 164 {
160 m_OSFunctionsEnabled = true; 165 m_OSFunctionsEnabled = true;
161 // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); 166 // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED");
@@ -166,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
166 m_ScriptDistanceFactor = 171 m_ScriptDistanceFactor =
167 m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); 172 m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
168 173
169 string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow"); 174 string risk = m_osslconfig.GetString("OSFunctionThreatLevel", "VeryLow");
170 switch (risk) 175 switch (risk)
171 { 176 {
172 case "NoAccess": 177 case "NoAccess":
@@ -292,8 +297,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
292 FunctionPerms perms = new FunctionPerms(); 297 FunctionPerms perms = new FunctionPerms();
293 m_FunctionPerms[function] = perms; 298 m_FunctionPerms[function] = perms;
294 299
295 string ownerPerm = m_ScriptEngine.Config.GetString("Allow_" + function, ""); 300 string ownerPerm = m_osslconfig.GetString("Allow_" + function, "");
296 string creatorPerm = m_ScriptEngine.Config.GetString("Creators_" + function, ""); 301 string creatorPerm = m_osslconfig.GetString("Creators_" + function, "");
297 if (ownerPerm == "" && creatorPerm == "") 302 if (ownerPerm == "" && creatorPerm == "")
298 { 303 {
299 // Default behavior 304 // Default behavior