aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-05-27 21:35:17 +0100
committerJustin Clark-Casey (justincc)2010-06-07 19:14:22 +0100
commit50ddb20204e8eb513212fe80d80b1308280fd47f (patch)
treef58c4ccd06a5f57985869f4679e3b208f59db912 /OpenSim/Region/Framework/Scenes/Scene.cs
parentRevert "commit code which stops full updates being fired multiple times when ... (diff)
downloadopensim-SC_OLD-50ddb20204e8eb513212fe80d80b1308280fd47f.zip
opensim-SC_OLD-50ddb20204e8eb513212fe80d80b1308280fd47f.tar.gz
opensim-SC_OLD-50ddb20204e8eb513212fe80d80b1308280fd47f.tar.bz2
opensim-SC_OLD-50ddb20204e8eb513212fe80d80b1308280fd47f.tar.xz
commit code which stops full updates being fired multiple times when attachments cross standalone region boundaries
lots of messy debug code here too which would need to be removed
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs43
1 files changed, 37 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e8c4978..f8ca047 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1850,9 +1850,31 @@ namespace OpenSim.Region.Framework.Scenes
1850 /// true if the object was added, false if an object with the same uuid was already in the scene 1850 /// true if the object was added, false if an object with the same uuid was already in the scene
1851 /// </returns> 1851 /// </returns>
1852 public bool AddRestoredSceneObject( 1852 public bool AddRestoredSceneObject(
1853 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
1854 {
1855 return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates);
1856 }
1857
1858 /// <summary>
1859 /// Add an object into the scene that has come from storage
1860 /// </summary>
1861 ///
1862 /// <param name="sceneObject"></param>
1863 /// <param name="attachToBackup">
1864 /// If true, changes to the object will be reflected in its persisted data
1865 /// If false, the persisted data will not be changed even if the object in the scene is changed
1866 /// </param>
1867 /// <param name="alreadyPersisted">
1868 /// If true, we won't persist this object until it changes
1869 /// If false, we'll persist this object immediately
1870 /// </param>
1871 /// <returns>
1872 /// true if the object was added, false if an object with the same uuid was already in the scene
1873 /// </returns>
1874 public bool AddRestoredSceneObject(
1853 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) 1875 SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
1854 { 1876 {
1855 return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted); 1877 return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true);
1856 } 1878 }
1857 1879
1858 /// <summary> 1880 /// <summary>
@@ -2465,7 +2487,7 @@ namespace OpenSim.Region.Framework.Scenes
2465 /// <returns></returns> 2487 /// <returns></returns>
2466 public bool IncomingCreateObject(ISceneObject sog) 2488 public bool IncomingCreateObject(ISceneObject sog)
2467 { 2489 {
2468 //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); 2490 m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
2469 SceneObjectGroup newObject; 2491 SceneObjectGroup newObject;
2470 try 2492 try
2471 { 2493 {
@@ -2537,10 +2559,12 @@ namespace OpenSim.Region.Framework.Scenes
2537 2559
2538 if (sceneObject.IsAttachmentCheckFull()) // Attachment 2560 if (sceneObject.IsAttachmentCheckFull()) // Attachment
2539 { 2561 {
2562 m_log.DebugFormat("[SCENE]: Adding attachment {0} {1}", sceneObject.Name, sceneObject.LocalId);
2563
2540 sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); 2564 sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez);
2541 sceneObject.RootPart.AddFlag(PrimFlags.Phantom); 2565 sceneObject.RootPart.AddFlag(PrimFlags.Phantom);
2542 2566
2543 AddRestoredSceneObject(sceneObject, false, false); 2567 AddRestoredSceneObject(sceneObject, false, false, false);
2544 2568
2545 // Handle attachment special case 2569 // Handle attachment special case
2546 SceneObjectPart RootPrim = sceneObject.RootPart; 2570 SceneObjectPart RootPrim = sceneObject.RootPart;
@@ -2548,6 +2572,8 @@ namespace OpenSim.Region.Framework.Scenes
2548 // Fix up attachment Parent Local ID 2572 // Fix up attachment Parent Local ID
2549 ScenePresence sp = GetScenePresence(sceneObject.OwnerID); 2573 ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
2550 2574
2575 Console.WriteLine("AAAA");
2576
2551 //uint parentLocalID = 0; 2577 //uint parentLocalID = 0;
2552 if (sp != null) 2578 if (sp != null)
2553 { 2579 {
@@ -2566,20 +2592,25 @@ namespace OpenSim.Region.Framework.Scenes
2566 //grp.SetFromAssetID(grp.RootPart.LastOwnerID); 2592 //grp.SetFromAssetID(grp.RootPart.LastOwnerID);
2567 m_log.DebugFormat( 2593 m_log.DebugFormat(
2568 "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); 2594 "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
2569 2595
2596 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2570 AttachObject( 2597 AttachObject(
2571 sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); 2598 sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
2572 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2599
2573 grp.SendGroupFullUpdate(); 2600 //grp.SendGroupFullUpdate();
2574 } 2601 }
2575 else 2602 else
2576 { 2603 {
2577 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2604 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2578 RootPrim.AddFlag(PrimFlags.TemporaryOnRez); 2605 RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
2579 } 2606 }
2607
2608 Console.WriteLine("BBBB");
2580 } 2609 }
2581 else 2610 else
2582 { 2611 {
2612 m_log.DebugFormat("[SCENE]: Adding ordinary object {0} {1}", sceneObject.Name, sceneObject.LocalId);
2613
2583 AddRestoredSceneObject(sceneObject, true, false); 2614 AddRestoredSceneObject(sceneObject, true, false);
2584 2615
2585 if (!Permissions.CanObjectEntry(sceneObject.UUID, 2616 if (!Permissions.CanObjectEntry(sceneObject.UUID,