From 0df0e92ff041797f763ecfd8bb5c9c5c4e33a99b Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Wed, 16 Mar 2011 16:36:54 -0700 Subject: [PATCH] In RegionSyncModule.DoInitialSync(), calling DeleteAllSceneObjectsBySync() instead of DeleteAllSceneObjects(). --- .../SymmetricSync/RegionSyncModule.cs | 3 ++- OpenSim/Region/Framework/Scenes/Scene.cs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs index 3f7e9f90c2..d72b5af3ea 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs @@ -1518,7 +1518,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule private void DoInitialSync() { - m_scene.DeleteAllSceneObjects(); + //m_scene.DeleteAllSceneObjects(); + m_scene.DeleteAllSceneObjectsBySync(); SendSyncMessage(SymmetricSyncMessage.MsgType.RegionName, m_scene.RegionInfo.RegionName); m_log.WarnFormat("Sending region name: \"{0}\"", m_scene.RegionInfo.RegionName); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5efd6d545f..54478ee046 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -689,6 +689,23 @@ namespace OpenSim.Region.Framework.Scenes return m_sceneGraph.UpdateObjectBySynchronization(sog); } + public void DeleteAllSceneObjectsBySync() + { + lock (Entities) + { + EntityBase[] entities = Entities.GetEntities(); + foreach (EntityBase e in entities) + { + if (e is SceneObjectGroup) + { + SceneObjectGroup sog = (SceneObjectGroup)e; + if (!sog.IsAttachment) + DeleteSceneObjectBySynchronization((SceneObjectGroup)e); + } + } + } + } + //Similar to DeleteSceneObject, except that this does not change LastUpdateActorID and LastUpdateTimeStamp public void DeleteSceneObjectBySynchronization(SceneObjectGroup group) {