aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs6
-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, 70 insertions, 43 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index af88c4a..01daeb1 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 d7120a5..1f3582c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -6151,7 +6151,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6151 DelinkObjects handlerDelinkObjects = OnDelinkObjects; 6151 DelinkObjects handlerDelinkObjects = OnDelinkObjects;
6152 if (handlerDelinkObjects != null) 6152 if (handlerDelinkObjects != null)
6153 { 6153 {
6154 handlerDelinkObjects(prims); 6154 handlerDelinkObjects(prims, this);
6155 } 6155 }
6156 6156
6157 return true; 6157 return true;
@@ -11820,4 +11820,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11820 OutPacket(dialog, ThrottleOutPacketType.Task); 11820 OutPacket(dialog, ThrottleOutPacketType.Task);
11821 } 11821 }
11822 } 11822 }
11823} \ No newline at end of file 11823}
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 01359f0..f6bb3fe 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1721,7 +1721,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1721 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1721 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1722 if (m_bypassPermissions) return m_bypassPermissionsValue; 1722 if (m_bypassPermissions) return m_bypassPermissionsValue;
1723 1723
1724 return true; 1724 return GenericObjectPermission(editorID, objectID, false);
1725 } 1725 }
1726 1726
1727 private bool CanDelinkObject(UUID userID, UUID objectID) 1727 private bool CanDelinkObject(UUID userID, UUID objectID)
@@ -1729,7 +1729,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1729 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1729 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1730 if (m_bypassPermissions) return m_bypassPermissionsValue; 1730 if (m_bypassPermissions) return m_bypassPermissionsValue;
1731 1731
1732 return true; 1732 return GenericObjectPermission(editorID, objectID, false);
1733 } 1733 }
1734 1734
1735 private bool CanBuyLand(UUID userID, ILandObject parcel, Scene scene) 1735 private bool CanBuyLand(UUID userID, ILandObject parcel, Scene scene)
@@ -1894,4 +1894,4 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1894 return(false); 1894 return(false);
1895 } 1895 }
1896 } 1896 }
1897} \ No newline at end of file 1897}
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
index f441aa9..6e69902 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 15b5230..6ebfd31 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1941,5 +1941,55 @@ namespace OpenSim.Region.Framework.Scenes
1941 part.GetProperties(remoteClient); 1941 part.GetProperties(remoteClient);
1942 } 1942 }
1943 } 1943 }
1944
1945 public void DelinkObjects(List<uint> primIds, IClientAPI client)
1946 {
1947 List<SceneObjectPart> parts = new List<SceneObjectPart>();
1948
1949 foreach (uint localID in primIds)
1950 {
1951 SceneObjectPart part = GetSceneObjectPart(localID);
1952
1953 if (part == null)
1954 continue;
1955
1956 if (Permissions.CanDelinkObject(client.AgentId, part.ParentGroup.RootPart.UUID))
1957 parts.Add(part);
1958 }
1959
1960 m_sceneGraph.DelinkObjects(parts);
1961 }
1962
1963 public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds)
1964 {
1965 List<UUID> owners = new List<UUID>();
1966
1967 List<SceneObjectPart> children = new List<SceneObjectPart>();
1968 SceneObjectPart root = GetSceneObjectPart(parentPrimId);
1969
1970 if (Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID))
1971 return;
1972
1973 foreach (uint localID in childPrimIds)
1974 {
1975 SceneObjectPart part = GetSceneObjectPart(localID);
1976
1977 if (part == null)
1978 continue;
1979
1980 if (!owners.Contains(part.OwnerID))
1981 owners.Add(part.OwnerID);
1982
1983 if (Permissions.CanLinkObject(client.AgentId, part.ParentGroup.RootPart.UUID))
1984 children.Add(part);
1985 }
1986
1987 // Must be all one owner
1988 //
1989 if (owners.Count > 1)
1990 return;
1991
1992 m_sceneGraph.LinkObjects(root, children);
1993 }
1944 } 1994 }
1945} 1995}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 57587be..61a2956 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;
@@ -2878,8 +2878,8 @@ namespace OpenSim.Region.Framework.Scenes
2878 client.OnObjectName -= m_sceneGraph.PrimName; 2878 client.OnObjectName -= m_sceneGraph.PrimName;
2879 client.OnObjectClickAction -= m_sceneGraph.PrimClickAction; 2879 client.OnObjectClickAction -= m_sceneGraph.PrimClickAction;
2880 client.OnObjectMaterial -= m_sceneGraph.PrimMaterial; 2880 client.OnObjectMaterial -= m_sceneGraph.PrimMaterial;
2881 client.OnLinkObjects -= m_sceneGraph.LinkObjects; 2881 client.OnLinkObjects -= LinkObjects;
2882 client.OnDelinkObjects -= m_sceneGraph.DelinkObjects; 2882 client.OnDelinkObjects -= DelinkObjects;
2883 client.OnObjectDuplicate -= m_sceneGraph.DuplicateObject; 2883 client.OnObjectDuplicate -= m_sceneGraph.DuplicateObject;
2884 client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay; 2884 client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay;
2885 client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags; 2885 client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags;
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 1421d0e..ce11267 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1463,20 +1463,21 @@ namespace OpenSim.Region.Framework.Scenes
1463 /// <param name="client"></param> 1463 /// <param name="client"></param>
1464 /// <param name="parentPrim"></param> 1464 /// <param name="parentPrim"></param>
1465 /// <param name="childPrims"></param> 1465 /// <param name="childPrims"></param>
1466 protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) 1466 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
1467 { 1467 {
1468 Monitor.Enter(m_updateLock); 1468 Monitor.Enter(m_updateLock);
1469 try 1469 try
1470 { 1470 {
1471 SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); 1471 SceneObjectGroup parentGroup = root.ParentGroup;
1472 1472
1473 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); 1473 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
1474 if (parentGroup != null) 1474 if (parentGroup != null)
1475 { 1475 {
1476 // We do this in reverse to get the link order of the prims correct 1476 // We do this in reverse to get the link order of the prims correct
1477 for (int i = childPrimIds.Count - 1; i >= 0; i--) 1477 for (int i = children.Count - 1; i >= 0; i--)
1478 { 1478 {
1479 SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); 1479 SceneObjectGroup child = children[i].ParentGroup;
1480
1480 if (child != null) 1481 if (child != null)
1481 { 1482 {
1482 // Make sure no child prim is set for sale 1483 // Make sure no child prim is set for sale
@@ -1509,17 +1510,6 @@ namespace OpenSim.Region.Framework.Scenes
1509 parentGroup.HasGroupChanged = true; 1510 parentGroup.HasGroupChanged = true;
1510 parentGroup.ScheduleGroupForFullUpdate(); 1511 parentGroup.ScheduleGroupForFullUpdate();
1511 1512
1512// if (client != null)
1513// {
1514// parentGroup.GetProperties(client);
1515// }
1516// else
1517// {
1518// foreach (ScenePresence p in GetScenePresences())
1519// {
1520// parentGroup.GetProperties(p.ControllingClient);
1521// }
1522// }
1523 } 1513 }
1524 finally 1514 finally
1525 { 1515 {
@@ -1531,12 +1521,7 @@ namespace OpenSim.Region.Framework.Scenes
1531 /// Delink a linkset 1521 /// Delink a linkset
1532 /// </summary> 1522 /// </summary>
1533 /// <param name="prims"></param> 1523 /// <param name="prims"></param>
1534 protected internal void DelinkObjects(List<uint> primIds) 1524 protected internal void DelinkObjects(List<SceneObjectPart> prims)
1535 {
1536 DelinkObjects(primIds, true);
1537 }
1538
1539 protected internal void DelinkObjects(List<uint> primIds, bool sendEvents)
1540 { 1525 {
1541 Monitor.Enter(m_updateLock); 1526 Monitor.Enter(m_updateLock);
1542 try 1527 try
@@ -1546,9 +1531,8 @@ namespace OpenSim.Region.Framework.Scenes
1546 List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>(); 1531 List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>();
1547 // Look them all up in one go, since that is comparatively expensive 1532 // Look them all up in one go, since that is comparatively expensive
1548 // 1533 //
1549 foreach (uint primID in primIds) 1534 foreach (SceneObjectPart part in prims)
1550 { 1535 {
1551 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID);
1552 if (part != null) 1536 if (part != null)
1553 { 1537 {
1554 if (part.ParentGroup.Children.Count != 1) // Skip single 1538 if (part.ParentGroup.Children.Count != 1) // Skip single
@@ -1563,17 +1547,13 @@ namespace OpenSim.Region.Framework.Scenes
1563 affectedGroups.Add(group); 1547 affectedGroups.Add(group);
1564 } 1548 }
1565 } 1549 }
1566 else
1567 {
1568 m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID);
1569 }
1570 } 1550 }
1571 1551
1572 foreach (SceneObjectPart child in childParts) 1552 foreach (SceneObjectPart child in childParts)
1573 { 1553 {
1574 // Unlink all child parts from their groups 1554 // Unlink all child parts from their groups
1575 // 1555 //
1576 child.ParentGroup.DelinkFromGroup(child, sendEvents); 1556 child.ParentGroup.DelinkFromGroup(child, true);
1577 } 1557 }
1578 1558
1579 foreach (SceneObjectPart root in rootParts) 1559 foreach (SceneObjectPart root in rootParts)
@@ -1628,12 +1608,9 @@ namespace OpenSim.Region.Framework.Scenes
1628 List<uint> linkIDs = new List<uint>(); 1608 List<uint> linkIDs = new List<uint>();
1629 1609
1630 foreach (SceneObjectPart newChild in newSet) 1610 foreach (SceneObjectPart newChild in newSet)
1631 {
1632 newChild.UpdateFlag = 0; 1611 newChild.UpdateFlag = 0;
1633 linkIDs.Add(newChild.LocalId);
1634 }
1635 1612
1636 LinkObjects(null, newRoot.LocalId, linkIDs); 1613 LinkObjects(newRoot, newSet);
1637 if (!affectedGroups.Contains(newRoot.ParentGroup)) 1614 if (!affectedGroups.Contains(newRoot.ParentGroup))
1638 affectedGroups.Add(newRoot.ParentGroup); 1615 affectedGroups.Add(newRoot.ParentGroup);
1639 } 1616 }