Thank you kindly, Idb for a patch that solves:

The following should silently fail when attached,
llBreakAllLinks, llBreakLink, llCreateLink.
The following should be restricted to avatars in the same sim,
llGetAgentInfo, llSameGroup, llGetAgentSize, llGetAnimationList.
Comment added to the following unimplemented functions,
llGetAgentLanguage, llGetAnimation.
0.6.0-stable
Charles Krinke 2008-10-26 18:26:56 +00:00
parent b552e8ebe3
commit ba79c26d2d
1 changed files with 14 additions and 3 deletions

View File

@ -2976,6 +2976,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient; IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient;
SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target); SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target);
if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0)
return; // Fail silently if attached
SceneObjectGroup parentPrim = null, childPrim = null; SceneObjectGroup parentPrim = null, childPrim = null;
if (targetPart != null) if (targetPart != null)
{ {
@ -3015,6 +3017,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (linknum < ScriptBaseClass.LINK_THIS) if (linknum < ScriptBaseClass.LINK_THIS)
return; return;
SceneObjectGroup parentPrim = m_host.ParentGroup; SceneObjectGroup parentPrim = m_host.ParentGroup;
if (parentPrim.RootPart.AttachmentPoint != 0)
return; // Fail silently if attached
SceneObjectPart childPrim = null; SceneObjectPart childPrim = null;
switch (linknum) switch (linknum)
{ {
@ -3072,6 +3076,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
SceneObjectGroup parentPrim = m_host.ParentGroup; SceneObjectGroup parentPrim = m_host.ParentGroup;
if (parentPrim.RootPart.AttachmentPoint != 0)
return; // Fail silently if attached
List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values); List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values);
parts.Remove(parentPrim.RootPart); parts.Remove(parentPrim.RootPart);
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
@ -3435,6 +3441,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llGetAnimation(string id) public LSL_String llGetAnimation(string id)
{ {
// This should only return a value if the avatar is in the same region
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llGetAnimation"); NotImplemented("llGetAnimation");
return String.Empty; return String.Empty;
@ -4649,6 +4656,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0; return 0;
} }
if (agent.IsChildAgent)
return 0; // Fail if they are not in the same region
// note: in OpenSim, sitting seems to cancel AGENT_ALWAYS_RUN, unlike SL // note: in OpenSim, sitting seems to cancel AGENT_ALWAYS_RUN, unlike SL
if (agent.SetAlwaysRun) if (agent.SetAlwaysRun)
{ {
@ -4728,6 +4738,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llGetAgentLanguage(string id) public LSL_String llGetAgentLanguage(string id)
{ {
// This should only return a value if the avatar is in the same region
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llGetAgentLanguage"); NotImplemented("llGetAgentLanguage");
return ""; return "";
@ -4933,7 +4944,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
ScenePresence avatar = World.GetScenePresence((UUID)id); ScenePresence avatar = World.GetScenePresence((UUID)id);
LSL_Vector agentSize; LSL_Vector agentSize;
if (avatar == null) if (avatar == null || avatar.IsChildAgent) // Fail if not in the same region
{ {
agentSize = ScriptBaseClass.ZERO_VECTOR; agentSize = ScriptBaseClass.ZERO_VECTOR;
} }
@ -4967,7 +4978,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!UUID.TryParse(agent, out agentId)) if (!UUID.TryParse(agent, out agentId))
return new LSL_Integer(0); return new LSL_Integer(0);
ScenePresence presence = World.GetScenePresence(agentId); ScenePresence presence = World.GetScenePresence(agentId);
if (presence == null) if (presence == null || presence.IsChildAgent) // Return flase for child agents
return new LSL_Integer(0); return new LSL_Integer(0);
IClientAPI client = presence.ControllingClient; IClientAPI client = presence.ControllingClient;
if (m_host.GroupID == client.ActiveGroupId) if (m_host.GroupID == client.ActiveGroupId)
@ -6374,7 +6385,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSL_List l = new LSL_List(); LSL_List l = new LSL_List();
ScenePresence av = World.GetScenePresence((UUID)id); ScenePresence av = World.GetScenePresence((UUID)id);
if (av == null) if (av == null || av.IsChildAgent) // only if in the region
return l; return l;
UUID[] anims; UUID[] anims;
anims = av.GetAnimationArray(); anims = av.GetAnimationArray();