mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Implement osForceCreateLink() and osForceBreakLink()
These are identical to llCreateLink() and llBreakLink() except that they don't require script permissions. However, osForceCreateLink() still requires that linked and linkee still have the same owner. There's also an AutomaticLinkPermission setting in [XEngine] that could be set to true to prevent the LSL function checks. But this doesn't allow the finer control over which users/scripts, etc. can do this that the OSSL functions provide.
This commit is contained in:
@@ -3769,10 +3769,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public void llCreateLink(string target, int parent)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
UUID targetID;
|
||||
|
||||
if (!UUID.TryParse(target, out targetID))
|
||||
return;
|
||||
|
||||
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
||||
&& !m_automaticLinkPermission)
|
||||
@@ -3781,10 +3777,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return;
|
||||
}
|
||||
|
||||
IClientAPI client = null;
|
||||
ScenePresence sp = World.GetScenePresence(m_item.PermsGranter);
|
||||
if (sp != null)
|
||||
client = sp.ControllingClient;
|
||||
CreateLink(target, parent);
|
||||
}
|
||||
|
||||
public void CreateLink(string target, int parent)
|
||||
{
|
||||
UUID targetID;
|
||||
|
||||
if (!UUID.TryParse(target, out targetID))
|
||||
return;
|
||||
|
||||
SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)targetID);
|
||||
|
||||
@@ -3819,6 +3820,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
parentPrim.HasGroupChanged = true;
|
||||
parentPrim.ScheduleGroupForFullUpdate();
|
||||
|
||||
IClientAPI client = null;
|
||||
ScenePresence sp = World.GetScenePresence(m_host.OwnerID);
|
||||
if (sp != null)
|
||||
client = sp.ControllingClient;
|
||||
|
||||
if (client != null)
|
||||
parentPrim.SendPropertiesToClient(client);
|
||||
|
||||
@@ -3836,6 +3842,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return;
|
||||
}
|
||||
|
||||
BreakLink(linknum);
|
||||
}
|
||||
|
||||
public void BreakLink(int linknum)
|
||||
{
|
||||
if (linknum < ScriptBaseClass.LINK_THIS)
|
||||
return;
|
||||
|
||||
|
||||
@@ -2330,6 +2330,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public void osForceCreateLink(string target, int parent)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.VeryLow, "osForceCreateLink");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
InitLSL();
|
||||
((LSL_Api)m_LSL_Api).CreateLink(target, parent);
|
||||
}
|
||||
|
||||
public void osForceBreakLink(int linknum)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakLink");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
InitLSL();
|
||||
((LSL_Api)m_LSL_Api).BreakLink(linknum);
|
||||
}
|
||||
|
||||
public LSL_Integer osIsNpc(LSL_Key npc)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osIsNpc");
|
||||
|
||||
Reference in New Issue
Block a user