From dfa19e23f03643762a10677203c088161a99557e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 8 Feb 2012 21:58:59 +0000 Subject: Stop a scene object from attempting to link with itself (which results in an exception and constant complaints in v3 viewers). Aims to address http://opensimulator.org/mantis/view.php?id=5878 --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 6d7559e..af01624 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2170,8 +2170,25 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGraph.DelinkObjects(parts); } + /// + /// Link the scene objects containing the indicated parts to a root object. + /// + /// + /// A root prim id of the object which will be the root prim of the resulting linkset. + /// A list of child prims for the objects that should be linked in. public void LinkObjects(IClientAPI client, uint parentPrimId, List childPrimIds) { + LinkObjects(client.AgentId, parentPrimId, childPrimIds); + } + + /// + /// Link the scene objects containing the indicated parts to a root object. + /// + /// The ID of the user linking. + /// A root prim id of the object which will be the root prim of the resulting linkset. + /// A list of child prims for the objects that should be linked in. + public void LinkObjects(UUID agentId, uint parentPrimId, List childPrimIds) + { List owners = new List(); List children = new List(); @@ -2183,7 +2200,7 @@ namespace OpenSim.Region.Framework.Scenes return; } - if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID)) + if (!Permissions.CanLinkObject(agentId, root.ParentGroup.RootPart.UUID)) { m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim"); return; @@ -2199,7 +2216,7 @@ namespace OpenSim.Region.Framework.Scenes if (!owners.Contains(part.OwnerID)) owners.Add(part.OwnerID); - if (Permissions.CanLinkObject(client.AgentId, part.ParentGroup.RootPart.UUID)) + if (Permissions.CanLinkObject(agentId, part.ParentGroup.RootPart.UUID)) children.Add(part); } -- cgit v1.1