aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs4
-rw-r--r--OpenSim/Region/DataSnapshot/ObjectSnapshot.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs50
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs41
7 files changed, 68 insertions, 41 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 222bae0..a6a081d 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Framework
73 73
74 public delegate void LinkObjects(IClientAPI remoteClient, uint parent, List<uint> children); 74 public delegate void LinkObjects(IClientAPI remoteClient, uint parent, List<uint> children);
75 75
76 public delegate void DelinkObjects(List<uint> primIds); 76 public delegate void DelinkObjects(List<uint> primIds, IClientAPI client);
77 77
78 public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag); 78 public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag);
79 79
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 8b81377..2ab713d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -6084,7 +6084,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6084 DelinkObjects handlerDelinkObjects = OnDelinkObjects; 6084 DelinkObjects handlerDelinkObjects = OnDelinkObjects;
6085 if (handlerDelinkObjects != null) 6085 if (handlerDelinkObjects != null)
6086 { 6086 {
6087 handlerDelinkObjects(prims); 6087 handlerDelinkObjects(prims, this);
6088 } 6088 }
6089 6089
6090 return true; 6090 return true;
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 1533462..b557186 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1592,7 +1592,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1592 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1592 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1593 if (m_bypassPermissions) return m_bypassPermissionsValue; 1593 if (m_bypassPermissions) return m_bypassPermissionsValue;
1594 1594
1595 return true; 1595 return GenericObjectPermission(userID, objectID, false);
1596 } 1596 }
1597 1597
1598 private bool CanDelinkObject(UUID userID, UUID objectID) 1598 private bool CanDelinkObject(UUID userID, UUID objectID)
@@ -1600,7 +1600,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1600 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1600 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1601 if (m_bypassPermissions) return m_bypassPermissionsValue; 1601 if (m_bypassPermissions) return m_bypassPermissionsValue;
1602 1602
1603 return true; 1603 return GenericObjectPermission(userID, objectID, false);
1604 } 1604 }
1605 1605
1606 private bool CanBuyLand(UUID userID, ILandObject parcel, Scene scene) 1606 private bool CanBuyLand(UUID userID, ILandObject parcel, Scene scene)
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
index 76dac61..62666a4 100644
--- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
69 byte RayEndIsIntersection) { this.Stale = true; }; 69 byte RayEndIsIntersection) { this.Stale = true; };
70 client.OnLinkObjects += delegate (IClientAPI remoteClient, uint parent, List<uint> children) 70 client.OnLinkObjects += delegate (IClientAPI remoteClient, uint parent, List<uint> children)
71 { this.Stale = true; }; 71 { this.Stale = true; };
72 client.OnDelinkObjects += delegate(List<uint> primIds) { this.Stale = true; }; 72 client.OnDelinkObjects += delegate(List<uint> primIds, IClientAPI clientApi) { this.Stale = true; };
73 client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos, 73 client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos,
74 IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) { this.Stale = true; }; 74 IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) { this.Stale = true; };
75 client.OnObjectAttach += delegate(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, 75 client.OnObjectAttach += delegate(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt,
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 5b21332..8716e0a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2568,5 +2568,55 @@ namespace OpenSim.Region.Framework.Scenes
2568 part.GetProperties(remoteClient); 2568 part.GetProperties(remoteClient);
2569 } 2569 }
2570 } 2570 }
2571
2572 public void DelinkObjects(List<uint> primIds, IClientAPI client)
2573 {
2574 List<SceneObjectPart> parts = new List<SceneObjectPart>();
2575
2576 foreach (uint localID in primIds)
2577 {
2578 SceneObjectPart part = GetSceneObjectPart(localID);
2579
2580 if (part == null)
2581 continue;
2582
2583 if (Permissions.CanDelinkObject(client.AgentId, part.ParentGroup.RootPart.UUID))
2584 parts.Add(part);
2585 }
2586
2587 m_sceneGraph.DelinkObjects(parts);
2588 }
2589
2590 public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds)
2591 {
2592 List<UUID> owners = new List<UUID>();
2593
2594 List<SceneObjectPart> children = new List<SceneObjectPart>();
2595 SceneObjectPart root = GetSceneObjectPart(parentPrimId);
2596
2597 if (Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID))
2598 return;
2599
2600 foreach (uint localID in childPrimIds)
2601 {
2602 SceneObjectPart part = GetSceneObjectPart(localID);
2603
2604 if (part == null)
2605 continue;
2606
2607 if (!owners.Contains(part.OwnerID))
2608 owners.Add(part.OwnerID);
2609
2610 if (Permissions.CanLinkObject(client.AgentId, part.ParentGroup.RootPart.UUID))
2611 children.Add(part);
2612 }
2613
2614 // Must be all one owner
2615 //
2616 if (owners.Count > 1)
2617 return;
2618
2619 m_sceneGraph.LinkObjects(root, children);
2620 }
2571 } 2621 }
2572} 2622}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7796b8d..637ebff 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2721,8 +2721,8 @@ namespace OpenSim.Region.Framework.Scenes
2721 client.OnObjectName += m_sceneGraph.PrimName; 2721 client.OnObjectName += m_sceneGraph.PrimName;
2722 client.OnObjectClickAction += m_sceneGraph.PrimClickAction; 2722 client.OnObjectClickAction += m_sceneGraph.PrimClickAction;
2723 client.OnObjectMaterial += m_sceneGraph.PrimMaterial; 2723 client.OnObjectMaterial += m_sceneGraph.PrimMaterial;
2724 client.OnLinkObjects += m_sceneGraph.LinkObjects; 2724 client.OnLinkObjects += LinkObjects;
2725 client.OnDelinkObjects += m_sceneGraph.DelinkObjects; 2725 client.OnDelinkObjects += DelinkObjects;
2726 client.OnObjectDuplicate += m_sceneGraph.DuplicateObject; 2726 client.OnObjectDuplicate += m_sceneGraph.DuplicateObject;
2727 client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; 2727 client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay;
2728 client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; 2728 client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags;
@@ -2877,8 +2877,8 @@ namespace OpenSim.Region.Framework.Scenes
2877 client.OnObjectName -= m_sceneGraph.PrimName; 2877 client.OnObjectName -= m_sceneGraph.PrimName;
2878 client.OnObjectClickAction -= m_sceneGraph.PrimClickAction; 2878 client.OnObjectClickAction -= m_sceneGraph.PrimClickAction;
2879 client.OnObjectMaterial -= m_sceneGraph.PrimMaterial; 2879 client.OnObjectMaterial -= m_sceneGraph.PrimMaterial;
2880 client.OnLinkObjects -= m_sceneGraph.LinkObjects; 2880 client.OnLinkObjects -= LinkObjects;
2881 client.OnDelinkObjects -= m_sceneGraph.DelinkObjects; 2881 client.OnDelinkObjects -= DelinkObjects;
2882 client.OnObjectDuplicate -= m_sceneGraph.DuplicateObject; 2882 client.OnObjectDuplicate -= m_sceneGraph.DuplicateObject;
2883 client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay; 2883 client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay;
2884 client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags; 2884 client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags;
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index d31b45e..ad24160 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1619,20 +1619,21 @@ namespace OpenSim.Region.Framework.Scenes
1619 /// <param name="client"></param> 1619 /// <param name="client"></param>
1620 /// <param name="parentPrim"></param> 1620 /// <param name="parentPrim"></param>
1621 /// <param name="childPrims"></param> 1621 /// <param name="childPrims"></param>
1622 protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) 1622 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
1623 { 1623 {
1624 Monitor.Enter(m_updateLock); 1624 Monitor.Enter(m_updateLock);
1625 try 1625 try
1626 { 1626 {
1627 SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); 1627 SceneObjectGroup parentGroup = root.ParentGroup;
1628 1628
1629 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); 1629 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
1630 if (parentGroup != null) 1630 if (parentGroup != null)
1631 { 1631 {
1632 // We do this in reverse to get the link order of the prims correct 1632 // We do this in reverse to get the link order of the prims correct
1633 for (int i = childPrimIds.Count - 1; i >= 0; i--) 1633 for (int i = children.Count - 1; i >= 0; i--)
1634 { 1634 {
1635 SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); 1635 SceneObjectGroup child = children[i].ParentGroup;
1636
1636 if (child != null) 1637 if (child != null)
1637 { 1638 {
1638 // Make sure no child prim is set for sale 1639 // Make sure no child prim is set for sale
@@ -1665,17 +1666,6 @@ namespace OpenSim.Region.Framework.Scenes
1665 parentGroup.HasGroupChanged = true; 1666 parentGroup.HasGroupChanged = true;
1666 parentGroup.ScheduleGroupForFullUpdate(); 1667 parentGroup.ScheduleGroupForFullUpdate();
1667 1668
1668// if (client != null)
1669// {
1670// parentGroup.GetProperties(client);
1671// }
1672// else
1673// {
1674// foreach (ScenePresence p in GetScenePresences())
1675// {
1676// parentGroup.GetProperties(p.ControllingClient);
1677// }
1678// }
1679 } 1669 }
1680 finally 1670 finally
1681 { 1671 {
@@ -1687,12 +1677,7 @@ namespace OpenSim.Region.Framework.Scenes
1687 /// Delink a linkset 1677 /// Delink a linkset
1688 /// </summary> 1678 /// </summary>
1689 /// <param name="prims"></param> 1679 /// <param name="prims"></param>
1690 protected internal void DelinkObjects(List<uint> primIds) 1680 protected internal void DelinkObjects(List<SceneObjectPart> prims)
1691 {
1692 DelinkObjects(primIds, true);
1693 }
1694
1695 protected internal void DelinkObjects(List<uint> primIds, bool sendEvents)
1696 { 1681 {
1697 Monitor.Enter(m_updateLock); 1682 Monitor.Enter(m_updateLock);
1698 try 1683 try
@@ -1702,9 +1687,8 @@ namespace OpenSim.Region.Framework.Scenes
1702 List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>(); 1687 List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>();
1703 // Look them all up in one go, since that is comparatively expensive 1688 // Look them all up in one go, since that is comparatively expensive
1704 // 1689 //
1705 foreach (uint primID in primIds) 1690 foreach (SceneObjectPart part in prims)
1706 { 1691 {
1707 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID);
1708 if (part != null) 1692 if (part != null)
1709 { 1693 {
1710 if (part.ParentGroup.Children.Count != 1) // Skip single 1694 if (part.ParentGroup.Children.Count != 1) // Skip single
@@ -1719,17 +1703,13 @@ namespace OpenSim.Region.Framework.Scenes
1719 affectedGroups.Add(group); 1703 affectedGroups.Add(group);
1720 } 1704 }
1721 } 1705 }
1722 else
1723 {
1724 m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID);
1725 }
1726 } 1706 }
1727 1707
1728 foreach (SceneObjectPart child in childParts) 1708 foreach (SceneObjectPart child in childParts)
1729 { 1709 {
1730 // Unlink all child parts from their groups 1710 // Unlink all child parts from their groups
1731 // 1711 //
1732 child.ParentGroup.DelinkFromGroup(child, sendEvents); 1712 child.ParentGroup.DelinkFromGroup(child, true);
1733 } 1713 }
1734 1714
1735 foreach (SceneObjectPart root in rootParts) 1715 foreach (SceneObjectPart root in rootParts)
@@ -1784,12 +1764,9 @@ namespace OpenSim.Region.Framework.Scenes
1784 List<uint> linkIDs = new List<uint>(); 1764 List<uint> linkIDs = new List<uint>();
1785 1765
1786 foreach (SceneObjectPart newChild in newSet) 1766 foreach (SceneObjectPart newChild in newSet)
1787 {
1788 newChild.UpdateFlag = 0; 1767 newChild.UpdateFlag = 0;
1789 linkIDs.Add(newChild.LocalId);
1790 }
1791 1768
1792 LinkObjects(null, newRoot.LocalId, linkIDs); 1769 LinkObjects(newRoot, newSet);
1793 if (!affectedGroups.Contains(newRoot.ParentGroup)) 1770 if (!affectedGroups.Contains(newRoot.ParentGroup))
1794 affectedGroups.Add(newRoot.ParentGroup); 1771 affectedGroups.Add(newRoot.ParentGroup);
1795 } 1772 }