aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index c834cc8..cba0757 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27using System; 27using System;
28using System.Collections.Generic;
28using System.Runtime.Remoting.Lifetime; 29using System.Runtime.Remoting.Lifetime;
29using OpenMetaverse; 30using OpenMetaverse;
30using Nini.Config; 31using Nini.Config;
@@ -106,6 +107,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
106 internal ThreatLevel m_MaxThreatLevel = ThreatLevel.VeryLow; 107 internal ThreatLevel m_MaxThreatLevel = ThreatLevel.VeryLow;
107 internal float m_ScriptDelayFactor = 1.0f; 108 internal float m_ScriptDelayFactor = 1.0f;
108 internal float m_ScriptDistanceFactor = 1.0f; 109 internal float m_ScriptDistanceFactor = 1.0f;
110 internal Dictionary<string, bool> m_FunctionPerms = new Dictionary<string, bool>();
109 111
110 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) 112 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
111 { 113 {
@@ -177,6 +179,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
177 179
178 protected void CheckThreatLevel(ThreatLevel level, string function) 180 protected void CheckThreatLevel(ThreatLevel level, string function)
179 { 181 {
182 if (!m_FunctionPerms.ContainsKey(function))
183 {
184 m_FunctionPerms[function] =
185 m_ScriptEngine.Config.GetBoolean("Allow_"+function, true);
186 }
187
188 if (!m_FunctionPerms[function])
189 return;
190
180 if (level > m_MaxThreatLevel) 191 if (level > m_MaxThreatLevel)
181 throw new Exception("Threat level too high - "+function); 192 throw new Exception("Threat level too high - "+function);
182 } 193 }