aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs61
1 files changed, 41 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 973891b..8a65b06 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -296,13 +296,15 @@ namespace OpenSim.Region.Framework.Scenes
296 } 296 }
297 } 297 }
298 298
299 bool ret = AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
300
299 if (attachToBackup && (!alreadyPersisted)) 301 if (attachToBackup && (!alreadyPersisted))
300 { 302 {
301 sceneObject.ForceInventoryPersistence(); 303 sceneObject.ForceInventoryPersistence();
302 sceneObject.HasGroupChanged = true; 304 sceneObject.HasGroupChanged = true;
303 } 305 }
304 306
305 return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); 307 return ret;
306 } 308 }
307 309
308 /// <summary> 310 /// <summary>
@@ -319,12 +321,17 @@ namespace OpenSim.Region.Framework.Scenes
319 /// </returns> 321 /// </returns>
320 protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) 322 protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
321 { 323 {
322 // Ensure that we persist this new scene object if it's not an 324
325
326 bool ret = AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
327
328 // Ensure that we persist this new scene object if it's not an
323 // attachment 329 // attachment
330
324 if (attachToBackup) 331 if (attachToBackup)
325 sceneObject.HasGroupChanged = true; 332 sceneObject.HasGroupChanged = true;
326 333
327 return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); 334 return ret;
328 } 335 }
329 336
330 /// <summary> 337 /// <summary>
@@ -432,13 +439,9 @@ namespace OpenSim.Region.Framework.Scenes
432 439
433 sceneObject.AttachToScene(m_parentScene); 440 sceneObject.AttachToScene(m_parentScene);
434 441
435 if (sendClientUpdates)
436 sceneObject.ScheduleGroupForFullUpdate();
437 442
438 Entities.Add(sceneObject); 443 Entities.Add(sceneObject);
439 444
440 if (attachToBackup)
441 sceneObject.AttachToBackup();
442 445
443 lock (SceneObjectGroupsByFullID) 446 lock (SceneObjectGroupsByFullID)
444 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 447 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
@@ -459,9 +462,29 @@ namespace OpenSim.Region.Framework.Scenes
459 SceneObjectGroupsByLocalPartID[part.LocalId] = sceneObject; 462 SceneObjectGroupsByLocalPartID[part.LocalId] = sceneObject;
460 } 463 }
461 464
465 if (sendClientUpdates)
466 sceneObject.ScheduleGroupForFullUpdate();
467
468 if (attachToBackup)
469 sceneObject.AttachToBackup();
470
462 return true; 471 return true;
463 } 472 }
464 473
474 public void updateScenePartGroup(SceneObjectPart part, SceneObjectGroup grp)
475 {
476 // no tests, caller has responsability...
477 lock (SceneObjectGroupsByFullPartID)
478 {
479 SceneObjectGroupsByFullPartID[part.UUID] = grp;
480 }
481
482 lock (SceneObjectGroupsByLocalPartID)
483 {
484 SceneObjectGroupsByLocalPartID[part.LocalId] = grp;
485 }
486 }
487
465 /// <summary> 488 /// <summary>
466 /// Delete an object from the scene 489 /// Delete an object from the scene
467 /// </summary> 490 /// </summary>
@@ -1804,7 +1827,7 @@ namespace OpenSim.Region.Framework.Scenes
1804 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); 1827 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
1805 1828
1806 // We do this in reverse to get the link order of the prims correct 1829 // We do this in reverse to get the link order of the prims correct
1807 for (int i = 0 ; i < children.Count ; i++) 1830 for (int i = 0; i < children.Count; i++)
1808 { 1831 {
1809 SceneObjectGroup child = children[i].ParentGroup; 1832 SceneObjectGroup child = children[i].ParentGroup;
1810 1833
@@ -1815,7 +1838,7 @@ namespace OpenSim.Region.Framework.Scenes
1815 // Make sure no child prim is set for sale 1838 // Make sure no child prim is set for sale
1816 // So that, on delink, no prims are unwittingly 1839 // So that, on delink, no prims are unwittingly
1817 // left for sale and sold off 1840 // left for sale and sold off
1818 1841
1819 if (child != null) 1842 if (child != null)
1820 { 1843 {
1821 child.RootPart.ObjectSaleType = 0; 1844 child.RootPart.ObjectSaleType = 0;
@@ -1850,12 +1873,13 @@ namespace OpenSim.Region.Framework.Scenes
1850 } 1873 }
1851 finally 1874 finally
1852 { 1875 {
1876/*
1853 lock (SceneObjectGroupsByLocalPartID) 1877 lock (SceneObjectGroupsByLocalPartID)
1854 { 1878 {
1855 foreach (SceneObjectPart part in parentGroup.Parts) 1879 foreach (SceneObjectPart part in parentGroup.Parts)
1856 SceneObjectGroupsByLocalPartID[part.LocalId] = parentGroup; 1880 SceneObjectGroupsByLocalPartID[part.LocalId] = parentGroup;
1857 } 1881 }
1858 1882*/
1859 parentGroup.AdjustChildPrimPermissions(); 1883 parentGroup.AdjustChildPrimPermissions();
1860 parentGroup.HasGroupChanged = true; 1884 parentGroup.HasGroupChanged = true;
1861 parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true); 1885 parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true);
@@ -1938,20 +1962,17 @@ namespace OpenSim.Region.Framework.Scenes
1938 // slated for unlink, we need to do this 1962 // slated for unlink, we need to do this
1939 // Unlink the remaining set 1963 // Unlink the remaining set
1940 // 1964 //
1941 bool sendEventsToRemainder = true; 1965 bool sendEventsToRemainder = false;
1942 if (numChildren > 1) 1966 if (numChildren == 2) // only one child prim no re-link needed
1943 sendEventsToRemainder = false; 1967 sendEventsToRemainder = true;
1944 1968
1945 foreach (SceneObjectPart p in newSet) 1969 foreach (SceneObjectPart p in newSet)
1946 { 1970 {
1947 if (p != group.RootPart) 1971 if (p != group.RootPart)
1948 { 1972 {
1949 group.DelinkFromGroup(p, sendEventsToRemainder); 1973 group.DelinkFromGroup(p, sendEventsToRemainder);
1950 if (numChildren > 2) 1974 if (sendEventsToRemainder) // finish single child prim now
1951 { 1975 {
1952 }
1953 else
1954 {
1955 p.ParentGroup.HasGroupChanged = true; 1976 p.ParentGroup.HasGroupChanged = true;
1956 p.ParentGroup.ScheduleGroupForFullUpdate(); 1977 p.ParentGroup.ScheduleGroupForFullUpdate();
1957 } 1978 }
@@ -1984,8 +2005,8 @@ namespace OpenSim.Region.Framework.Scenes
1984 newChild.ClearUpdateSchedule(); 2005 newChild.ClearUpdateSchedule();
1985 2006
1986 LinkObjects(newRoot, newSet); 2007 LinkObjects(newRoot, newSet);
1987 if (!affectedGroups.Contains(newRoot.ParentGroup)) 2008// if (!affectedGroups.Contains(newRoot.ParentGroup))
1988 affectedGroups.Add(newRoot.ParentGroup); 2009// affectedGroups.Add(newRoot.ParentGroup);
1989 } 2010 }
1990 } 2011 }
1991 2012