Implement osForceBreakAllLinks().

Identical to llBreakAllLinks() except that it doesn't require the script to have link permissions.
0.8.0.3
Justin Clark-Casey (justincc) 2014-03-13 00:04:20 +00:00
parent 6a279feb2f
commit 873eee5431
4 changed files with 25 additions and 0 deletions

View File

@ -3930,6 +3930,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
} }
BreakAllLinks();
}
public void BreakAllLinks()
{
SceneObjectGroup parentPrim = m_host.ParentGroup; SceneObjectGroup parentPrim = m_host.ParentGroup;
if (parentPrim.AttachmentPoint != 0) if (parentPrim.AttachmentPoint != 0)
return; // Fail silently if attached return; // Fail silently if attached

View File

@ -2350,6 +2350,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
((LSL_Api)m_LSL_Api).BreakLink(linknum); ((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) public LSL_Integer osIsNpc(LSL_Key npc)
{ {
CheckThreatLevel(ThreatLevel.None, "osIsNpc"); CheckThreatLevel(ThreatLevel.None, "osIsNpc");

View File

@ -306,6 +306,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
/// <param name='linknum'></param> /// <param name='linknum'></param>
void osForceBreakLink(int linknum); void osForceBreakLink(int linknum);
/// <summary>
/// Identical to llBreakAllLinks() but does not require permission from the owner.
/// </summary>
void osForceBreakAllLinks();
/// <summary> /// <summary>
/// Check if the given key is an npc /// Check if the given key is an npc
/// </summary> /// </summary>

View File

@ -552,6 +552,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osForceBreakLink(linknum); m_OSSL_Functions.osForceBreakLink(linknum);
} }
public void osForceBreakAllLinks()
{
m_OSSL_Functions.osForceBreakAllLinks();
}
public LSL_Integer osIsNpc(LSL_Key npc) public LSL_Integer osIsNpc(LSL_Key npc)
{ {
return m_OSSL_Functions.osIsNpc(npc); return m_OSSL_Functions.osIsNpc(npc);