aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs41
1 files changed, 9 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 3ac34d3..f43de20 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1487,20 +1487,21 @@ namespace OpenSim.Region.Framework.Scenes
1487 /// <param name="client"></param> 1487 /// <param name="client"></param>
1488 /// <param name="parentPrim"></param> 1488 /// <param name="parentPrim"></param>
1489 /// <param name="childPrims"></param> 1489 /// <param name="childPrims"></param>
1490 protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) 1490 protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
1491 { 1491 {
1492 Monitor.Enter(m_updateLock); 1492 Monitor.Enter(m_updateLock);
1493 try 1493 try
1494 { 1494 {
1495 SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); 1495 SceneObjectGroup parentGroup = root.ParentGroup;
1496 1496
1497 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); 1497 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
1498 if (parentGroup != null) 1498 if (parentGroup != null)
1499 { 1499 {
1500 // We do this in reverse to get the link order of the prims correct 1500 // We do this in reverse to get the link order of the prims correct
1501 for (int i = childPrimIds.Count - 1; i >= 0; i--) 1501 for (int i = children.Count - 1; i >= 0; i--)
1502 { 1502 {
1503 SceneObjectGroup child = GetGroupByPrim(childPrimIds[i]); 1503 SceneObjectGroup child = children[i].ParentGroup;
1504
1504 if (child != null) 1505 if (child != null)
1505 { 1506 {
1506 // Make sure no child prim is set for sale 1507 // Make sure no child prim is set for sale
@@ -1533,17 +1534,6 @@ namespace OpenSim.Region.Framework.Scenes
1533 parentGroup.HasGroupChanged = true; 1534 parentGroup.HasGroupChanged = true;
1534 parentGroup.ScheduleGroupForFullUpdate(); 1535 parentGroup.ScheduleGroupForFullUpdate();
1535 1536
1536// if (client != null)
1537// {
1538// parentGroup.GetProperties(client);
1539// }
1540// else
1541// {
1542// foreach (ScenePresence p in GetScenePresences())
1543// {
1544// parentGroup.GetProperties(p.ControllingClient);
1545// }
1546// }
1547 } 1537 }
1548 finally 1538 finally
1549 { 1539 {
@@ -1555,12 +1545,7 @@ namespace OpenSim.Region.Framework.Scenes
1555 /// Delink a linkset 1545 /// Delink a linkset
1556 /// </summary> 1546 /// </summary>
1557 /// <param name="prims"></param> 1547 /// <param name="prims"></param>
1558 protected internal void DelinkObjects(List<uint> primIds) 1548 protected internal void DelinkObjects(List<SceneObjectPart> prims)
1559 {
1560 DelinkObjects(primIds, true);
1561 }
1562
1563 protected internal void DelinkObjects(List<uint> primIds, bool sendEvents)
1564 { 1549 {
1565 Monitor.Enter(m_updateLock); 1550 Monitor.Enter(m_updateLock);
1566 try 1551 try
@@ -1570,9 +1555,8 @@ namespace OpenSim.Region.Framework.Scenes
1570 List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>(); 1555 List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>();
1571 // Look them all up in one go, since that is comparatively expensive 1556 // Look them all up in one go, since that is comparatively expensive
1572 // 1557 //
1573 foreach (uint primID in primIds) 1558 foreach (SceneObjectPart part in prims)
1574 { 1559 {
1575 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID);
1576 if (part != null) 1560 if (part != null)
1577 { 1561 {
1578 if (part.ParentGroup.Children.Count != 1) // Skip single 1562 if (part.ParentGroup.Children.Count != 1) // Skip single
@@ -1587,17 +1571,13 @@ namespace OpenSim.Region.Framework.Scenes
1587 affectedGroups.Add(group); 1571 affectedGroups.Add(group);
1588 } 1572 }
1589 } 1573 }
1590 else
1591 {
1592 m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID);
1593 }
1594 } 1574 }
1595 1575
1596 foreach (SceneObjectPart child in childParts) 1576 foreach (SceneObjectPart child in childParts)
1597 { 1577 {
1598 // Unlink all child parts from their groups 1578 // Unlink all child parts from their groups
1599 // 1579 //
1600 child.ParentGroup.DelinkFromGroup(child, sendEvents); 1580 child.ParentGroup.DelinkFromGroup(child, true);
1601 } 1581 }
1602 1582
1603 foreach (SceneObjectPart root in rootParts) 1583 foreach (SceneObjectPart root in rootParts)
@@ -1652,12 +1632,9 @@ namespace OpenSim.Region.Framework.Scenes
1652 List<uint> linkIDs = new List<uint>(); 1632 List<uint> linkIDs = new List<uint>();
1653 1633
1654 foreach (SceneObjectPart newChild in newSet) 1634 foreach (SceneObjectPart newChild in newSet)
1655 {
1656 newChild.UpdateFlag = 0; 1635 newChild.UpdateFlag = 0;
1657 linkIDs.Add(newChild.LocalId);
1658 }
1659 1636
1660 LinkObjects(null, newRoot.LocalId, linkIDs); 1637 LinkObjects(newRoot, newSet);
1661 if (!affectedGroups.Contains(newRoot.ParentGroup)) 1638 if (!affectedGroups.Contains(newRoot.ParentGroup))
1662 affectedGroups.Add(newRoot.ParentGroup); 1639 affectedGroups.Add(newRoot.ParentGroup);
1663 } 1640 }