aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
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 637ebff..dd2d2cc 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>
@@ -2461,7 +2483,7 @@ namespace OpenSim.Region.Framework.Scenes
2461 /// <returns></returns> 2483 /// <returns></returns>
2462 public bool IncomingCreateObject(ISceneObject sog) 2484 public bool IncomingCreateObject(ISceneObject sog)
2463 { 2485 {
2464 //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); 2486 m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
2465 SceneObjectGroup newObject; 2487 SceneObjectGroup newObject;
2466 try 2488 try
2467 { 2489 {
@@ -2533,10 +2555,12 @@ namespace OpenSim.Region.Framework.Scenes
2533 2555
2534 if (sceneObject.IsAttachmentCheckFull()) // Attachment 2556 if (sceneObject.IsAttachmentCheckFull()) // Attachment
2535 { 2557 {
2558 m_log.DebugFormat("[SCENE]: Adding attachment {0} {1}", sceneObject.Name, sceneObject.LocalId);
2559
2536 sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); 2560 sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez);
2537 sceneObject.RootPart.AddFlag(PrimFlags.Phantom); 2561 sceneObject.RootPart.AddFlag(PrimFlags.Phantom);
2538 2562
2539 AddRestoredSceneObject(sceneObject, false, false); 2563 AddRestoredSceneObject(sceneObject, false, false, false);
2540 2564
2541 // Handle attachment special case 2565 // Handle attachment special case
2542 SceneObjectPart RootPrim = sceneObject.RootPart; 2566 SceneObjectPart RootPrim = sceneObject.RootPart;
@@ -2544,6 +2568,8 @@ namespace OpenSim.Region.Framework.Scenes
2544 // Fix up attachment Parent Local ID 2568 // Fix up attachment Parent Local ID
2545 ScenePresence sp = GetScenePresence(sceneObject.OwnerID); 2569 ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
2546 2570
2571 Console.WriteLine("AAAA");
2572
2547 //uint parentLocalID = 0; 2573 //uint parentLocalID = 0;
2548 if (sp != null) 2574 if (sp != null)
2549 { 2575 {
@@ -2562,20 +2588,25 @@ namespace OpenSim.Region.Framework.Scenes
2562 //grp.SetFromAssetID(grp.RootPart.LastOwnerID); 2588 //grp.SetFromAssetID(grp.RootPart.LastOwnerID);
2563 m_log.DebugFormat( 2589 m_log.DebugFormat(
2564 "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); 2590 "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
2565 2591
2592 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2566 AttachObject( 2593 AttachObject(
2567 sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); 2594 sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
2568 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2595
2569 grp.SendGroupFullUpdate(); 2596 //grp.SendGroupFullUpdate();
2570 } 2597 }
2571 else 2598 else
2572 { 2599 {
2573 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2600 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2574 RootPrim.AddFlag(PrimFlags.TemporaryOnRez); 2601 RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
2575 } 2602 }
2603
2604 Console.WriteLine("BBBB");
2576 } 2605 }
2577 else 2606 else
2578 { 2607 {
2608 m_log.DebugFormat("[SCENE]: Adding ordinary object {0} {1}", sceneObject.Name, sceneObject.LocalId);
2609
2579 AddRestoredSceneObject(sceneObject, true, false); 2610 AddRestoredSceneObject(sceneObject, true, false);
2580 2611
2581 if (!Permissions.CanObjectEntry(sceneObject.UUID, 2612 if (!Permissions.CanObjectEntry(sceneObject.UUID,