diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 756b81e..48ffbce 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2094,8 +2094,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
2094 | sceneObject.ScheduleGroupForFullUpdate(); | 2094 | sceneObject.ScheduleGroupForFullUpdate(); |
2095 | 2095 | ||
2096 | return sceneObject; | 2096 | return sceneObject; |
2097 | } | ||
2098 | |||
2099 | /// <summary> | ||
2100 | /// Add an object into the scene that has come from storage | ||
2101 | /// </summary> | ||
2102 | /// | ||
2103 | /// <param name="sceneObject"></param> | ||
2104 | /// <param name="attachToBackup"> | ||
2105 | /// If true, changes to the object will be reflected in its persisted data | ||
2106 | /// If false, the persisted data will not be changed even if the object in the scene is changed | ||
2107 | /// </param> | ||
2108 | /// <param name="alreadyPersisted"> | ||
2109 | /// If true, we won't persist this object until it changes | ||
2110 | /// If false, we'll persist this object immediately | ||
2111 | /// </param> | ||
2112 | /// <param name="sendClientUpdates"> | ||
2113 | /// If true, we send updates to the client to tell it about this object | ||
2114 | /// If false, we leave it up to the caller to do this | ||
2115 | /// </param> | ||
2116 | /// <returns> | ||
2117 | /// true if the object was added, false if an object with the same uuid was already in the scene | ||
2118 | /// </returns> | ||
2119 | public bool AddRestoredSceneObject( | ||
2120 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) | ||
2121 | { | ||
2122 | return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates); | ||
2097 | } | 2123 | } |
2098 | 2124 | ||
2099 | /// <summary> | 2125 | /// <summary> |
2100 | /// Add an object into the scene that has come from storage | 2126 | /// Add an object into the scene that has come from storage |
2101 | /// </summary> | 2127 | /// </summary> |
@@ -2115,7 +2141,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2115 | public bool AddRestoredSceneObject( | 2141 | public bool AddRestoredSceneObject( |
2116 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 2142 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
2117 | { | 2143 | { |
2118 | return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted); | 2144 | return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true); |
2119 | } | 2145 | } |
2120 | 2146 | ||
2121 | /// <summary> | 2147 | /// <summary> |
@@ -2555,7 +2581,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2555 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); | 2581 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); |
2556 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); | 2582 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); |
2557 | 2583 | ||
2558 | AddRestoredSceneObject(sceneObject, false, false); | 2584 | |
2585 | // Don't sent a full update here because this will cause full updates to be sent twice for | ||
2586 | // attachments on region crossings, resulting in viewer glitches. | ||
2587 | AddRestoredSceneObject(sceneObject, false, false, false); | ||
2559 | 2588 | ||
2560 | // Handle attachment special case | 2589 | // Handle attachment special case |
2561 | SceneObjectPart RootPrim = sceneObject.RootPart; | 2590 | SceneObjectPart RootPrim = sceneObject.RootPart; |
@@ -2582,12 +2611,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2582 | m_log.DebugFormat( | 2611 | m_log.DebugFormat( |
2583 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); | 2612 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); |
2584 | 2613 | ||
2614 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | ||
2615 | |||
2585 | if (AttachmentsModule != null) | 2616 | if (AttachmentsModule != null) |
2586 | AttachmentsModule.AttachObject( | 2617 | AttachmentsModule.AttachObject( |
2587 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); | 2618 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); |
2588 | 2619 | ||
2589 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2620 | //grp.SendGroupFullUpdate(); |
2590 | grp.SendGroupFullUpdate(); | ||
2591 | } | 2621 | } |
2592 | else | 2622 | else |
2593 | { | 2623 | { |