diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 637ebff..7089368 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> |
@@ -1886,7 +1908,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1886 | } | 1908 | } |
1887 | 1909 | ||
1888 | /// <summary> | 1910 | /// <summary> |
1889 | /// Delete every object from the scene | 1911 | /// Delete every object from the scene. This does not include attachments worn by avatars. |
1890 | /// </summary> | 1912 | /// </summary> |
1891 | public void DeleteAllSceneObjects() | 1913 | public void DeleteAllSceneObjects() |
1892 | { | 1914 | { |
@@ -1897,7 +1919,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1897 | foreach (EntityBase e in entities) | 1919 | foreach (EntityBase e in entities) |
1898 | { | 1920 | { |
1899 | if (e is SceneObjectGroup) | 1921 | if (e is SceneObjectGroup) |
1900 | DeleteSceneObject((SceneObjectGroup)e, false); | 1922 | { |
1923 | SceneObjectGroup sog = (SceneObjectGroup)e; | ||
1924 | if (!sog.IsAttachment) | ||
1925 | DeleteSceneObject((SceneObjectGroup)e, false); | ||
1926 | } | ||
1901 | } | 1927 | } |
1902 | } | 1928 | } |
1903 | } | 1929 | } |
@@ -2461,7 +2487,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2461 | /// <returns></returns> | 2487 | /// <returns></returns> |
2462 | public bool IncomingCreateObject(ISceneObject sog) | 2488 | public bool IncomingCreateObject(ISceneObject sog) |
2463 | { | 2489 | { |
2464 | //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); |
2465 | SceneObjectGroup newObject; | 2491 | SceneObjectGroup newObject; |
2466 | try | 2492 | try |
2467 | { | 2493 | { |
@@ -2533,10 +2559,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2533 | 2559 | ||
2534 | if (sceneObject.IsAttachmentCheckFull()) // Attachment | 2560 | if (sceneObject.IsAttachmentCheckFull()) // Attachment |
2535 | { | 2561 | { |
2562 | // m_log.DebugFormat("[SCENE]: Adding attachment {0} {1}", sceneObject.Name, sceneObject.LocalId); | ||
2563 | |||
2536 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); | 2564 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); |
2537 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); | 2565 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); |
2538 | 2566 | ||
2539 | AddRestoredSceneObject(sceneObject, false, false); | 2567 | AddRestoredSceneObject(sceneObject, false, false, false); |
2540 | 2568 | ||
2541 | // Handle attachment special case | 2569 | // Handle attachment special case |
2542 | SceneObjectPart RootPrim = sceneObject.RootPart; | 2570 | SceneObjectPart RootPrim = sceneObject.RootPart; |
@@ -2544,6 +2572,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2544 | // Fix up attachment Parent Local ID | 2572 | // Fix up attachment Parent Local ID |
2545 | ScenePresence sp = GetScenePresence(sceneObject.OwnerID); | 2573 | ScenePresence sp = GetScenePresence(sceneObject.OwnerID); |
2546 | 2574 | ||
2575 | // Console.WriteLine("AAAA"); | ||
2576 | |||
2547 | //uint parentLocalID = 0; | 2577 | //uint parentLocalID = 0; |
2548 | if (sp != null) | 2578 | if (sp != null) |
2549 | { | 2579 | { |
@@ -2562,20 +2592,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
2562 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); | 2592 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); |
2563 | m_log.DebugFormat( | 2593 | m_log.DebugFormat( |
2564 | "[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); |
2565 | 2595 | ||
2596 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | ||
2566 | AttachObject( | 2597 | AttachObject( |
2567 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); | 2598 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); |
2568 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2599 | |
2569 | grp.SendGroupFullUpdate(); | 2600 | //grp.SendGroupFullUpdate(); |
2570 | } | 2601 | } |
2571 | else | 2602 | else |
2572 | { | 2603 | { |
2573 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2604 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2574 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2605 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2575 | } | 2606 | } |
2607 | |||
2608 | // Console.WriteLine("BBBB"); | ||
2576 | } | 2609 | } |
2577 | else | 2610 | else |
2578 | { | 2611 | { |
2612 | // m_log.DebugFormat("[SCENE]: Adding ordinary object {0} {1}", sceneObject.Name, sceneObject.LocalId); | ||
2613 | |||
2579 | AddRestoredSceneObject(sceneObject, true, false); | 2614 | AddRestoredSceneObject(sceneObject, true, false); |
2580 | 2615 | ||
2581 | if (!Permissions.CanObjectEntry(sceneObject.UUID, | 2616 | if (!Permissions.CanObjectEntry(sceneObject.UUID, |