diff options
author | Melanie Thielker | 2008-09-15 15:36:51 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-15 15:36:51 +0000 |
commit | bf8b70ebeb82485047d61ae197bb037320bace5f (patch) | |
tree | 30c367c660ad18b8f1074d41fce04f542a91c1dd /OpenSim/Region/ScriptEngine/Shared | |
parent | Add more granularity and a risk asessment system to the OSSL API in XEngine. (diff) | |
download | opensim-SC-bf8b70ebeb82485047d61ae197bb037320bace5f.zip opensim-SC-bf8b70ebeb82485047d61ae197bb037320bace5f.tar.gz opensim-SC-bf8b70ebeb82485047d61ae197bb037320bace5f.tar.bz2 opensim-SC-bf8b70ebeb82485047d61ae197bb037320bace5f.tar.xz |
Add the option to use Allow_osFunction = false for each OS function
in the XEngine section
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 11 |
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 | */ |
27 | using System; | 27 | using System; |
28 | using System.Collections.Generic; | ||
28 | using System.Runtime.Remoting.Lifetime; | 29 | using System.Runtime.Remoting.Lifetime; |
29 | using OpenMetaverse; | 30 | using OpenMetaverse; |
30 | using Nini.Config; | 31 | using 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 | } |