From 873eee543192632a7febb99aa77b53d14d926674 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 13 Mar 2014 00:04:20 +0000
Subject: Implement osForceBreakAllLinks().
Identical to llBreakAllLinks() except that it doesn't require the script to have link permissions.
---
.../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++++
.../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 10 ++++++++++
OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 5 +++++
OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++
4 files changed, 25 insertions(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index abd8123..2275c37 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3930,6 +3930,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return;
}
+ BreakAllLinks();
+ }
+
+ public void BreakAllLinks()
+ {
SceneObjectGroup parentPrim = m_host.ParentGroup;
if (parentPrim.AttachmentPoint != 0)
return; // Fail silently if attached
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index cfc48e9..6302455 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2350,6 +2350,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
((LSL_Api)m_LSL_Api).BreakLink(linknum);
}
+ public void osForceBreakAllLinks()
+ {
+ CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakAllLinks");
+
+ m_host.AddScriptLPS(1);
+
+ InitLSL();
+ ((LSL_Api)m_LSL_Api).BreakAllLinks();
+ }
+
public LSL_Integer osIsNpc(LSL_Key npc)
{
CheckThreatLevel(ThreatLevel.None, "osIsNpc");
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index b5de355..41d13ea 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -307,6 +307,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osForceBreakLink(int linknum);
///
+ /// Identical to llBreakAllLinks() but does not require permission from the owner.
+ ///
+ void osForceBreakAllLinks();
+
+ ///
/// Check if the given key is an npc
///
///
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 7d5e568..b436c52 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -552,6 +552,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osForceBreakLink(linknum);
}
+ public void osForceBreakAllLinks()
+ {
+ m_OSSL_Functions.osForceBreakAllLinks();
+ }
+
public LSL_Integer osIsNpc(LSL_Key npc)
{
return m_OSSL_Functions.osIsNpc(npc);
--
cgit v1.1