diff options
author | Justin Clark-Casey (justincc) | 2012-02-08 21:58:59 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-08 22:19:34 +0000 |
commit | dfa19e23f03643762a10677203c088161a99557e (patch) | |
tree | ced1397f035e87f3b922a41892d41c7f30595e84 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | Make WebStats logging report consistently as WEB STATS MODULE instead of VC, ... (diff) | |
download | opensim-SC_OLD-dfa19e23f03643762a10677203c088161a99557e.zip opensim-SC_OLD-dfa19e23f03643762a10677203c088161a99557e.tar.gz opensim-SC_OLD-dfa19e23f03643762a10677203c088161a99557e.tar.bz2 opensim-SC_OLD-dfa19e23f03643762a10677203c088161a99557e.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 21 |
1 files changed, 19 insertions, 2 deletions
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 | |||
2170 | m_sceneGraph.DelinkObjects(parts); | 2170 | m_sceneGraph.DelinkObjects(parts); |
2171 | } | 2171 | } |
2172 | 2172 | ||
2173 | /// <summary> | ||
2174 | /// Link the scene objects containing the indicated parts to a root object. | ||
2175 | /// </summary> | ||
2176 | /// <param name="client"></param> | ||
2177 | /// <param name="parentPrimId">A root prim id of the object which will be the root prim of the resulting linkset.</param> | ||
2178 | /// <param name="childPrimIds">A list of child prims for the objects that should be linked in.</param> | ||
2173 | public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) | 2179 | public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) |
2174 | { | 2180 | { |
2181 | LinkObjects(client.AgentId, parentPrimId, childPrimIds); | ||
2182 | } | ||
2183 | |||
2184 | /// <summary> | ||
2185 | /// Link the scene objects containing the indicated parts to a root object. | ||
2186 | /// </summary> | ||
2187 | /// <param name="agentId">The ID of the user linking.</param> | ||
2188 | /// <param name="parentPrimId">A root prim id of the object which will be the root prim of the resulting linkset.</param> | ||
2189 | /// <param name="childPrimIds">A list of child prims for the objects that should be linked in.</param> | ||
2190 | public void LinkObjects(UUID agentId, uint parentPrimId, List<uint> childPrimIds) | ||
2191 | { | ||
2175 | List<UUID> owners = new List<UUID>(); | 2192 | List<UUID> owners = new List<UUID>(); |
2176 | 2193 | ||
2177 | List<SceneObjectPart> children = new List<SceneObjectPart>(); | 2194 | List<SceneObjectPart> children = new List<SceneObjectPart>(); |
@@ -2183,7 +2200,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2183 | return; | 2200 | return; |
2184 | } | 2201 | } |
2185 | 2202 | ||
2186 | if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID)) | 2203 | if (!Permissions.CanLinkObject(agentId, root.ParentGroup.RootPart.UUID)) |
2187 | { | 2204 | { |
2188 | m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim"); | 2205 | m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim"); |
2189 | return; | 2206 | return; |
@@ -2199,7 +2216,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2199 | if (!owners.Contains(part.OwnerID)) | 2216 | if (!owners.Contains(part.OwnerID)) |
2200 | owners.Add(part.OwnerID); | 2217 | owners.Add(part.OwnerID); |
2201 | 2218 | ||
2202 | if (Permissions.CanLinkObject(client.AgentId, part.ParentGroup.RootPart.UUID)) | 2219 | if (Permissions.CanLinkObject(agentId, part.ParentGroup.RootPart.UUID)) |
2203 | children.Add(part); | 2220 | children.Add(part); |
2204 | } | 2221 | } |
2205 | 2222 | ||