From 40e37d8b78379db08de541c8c7a9fed1d22ec5ef Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 24 Apr 2012 00:03:57 +0100
Subject: Add osForceAttachToAvatar() and osForceDetachFromAvatar()
These behave identically to llAttachToAvatar() and llDetachFromAvatar() except that they do not enforce the PERMISSION_ATTACH check
Intended for use in completely controlled dedicated environments where these checks are more a UI hinderance than a help.
Threat level high.
---
.../Shared/Api/Implementation/OSSL_Api.cs | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
(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 fe94b79..3f261ea 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -209,6 +209,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
throw new Exception("OSSL Runtime Error: " + msg);
}
+ ///
+ /// Initialize the LSL interface.
+ ///
+ ///
+ /// FIXME: This is an abomination. We should be able to set this up earlier but currently we have no
+ /// guarantee the interface is present on Initialize(). There needs to be another post initialize call from
+ /// ScriptInstance.
+ ///
private void InitLSL()
{
if (m_LSL_Api != null)
@@ -3093,5 +3101,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high);
}
}
+
+ public void osForceAttachToAvatar(int attachmentPoint)
+ {
+ CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar");
+
+ m_host.AddScriptLPS(1);
+
+ InitLSL();
+ ((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint);
+ }
+
+ public void osForceDetachFromAvatar()
+ {
+ CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar");
+
+ m_host.AddScriptLPS(1);
+
+ InitLSL();
+ ((LSL_Api)m_LSL_Api).DetachFromAvatar();
+ }
}
}
\ No newline at end of file
--
cgit v1.1
From 6011bfa5e36d77ad58cf50ddd99b8c6289144f57 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Mon, 23 Apr 2012 19:19:08 +0300
Subject: OSSL: fixed the threat level check for osParseJSONNew
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(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 3f261ea..7fc7337 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1617,7 +1617,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public Object osParseJSONNew(string JSON)
{
- CheckThreatLevel(ThreatLevel.None, "osParseJSON");
+ CheckThreatLevel(ThreatLevel.None, "osParseJSONNew");
m_host.AddScriptLPS(1);
--
cgit v1.1