In RegionSyncModule.DoInitialSync(), calling DeleteAllSceneObjectsBySync() instead of DeleteAllSceneObjects().

dsg
Huaiyu (Kitty) Liu 2011-03-16 16:36:54 -07:00
parent 271f460bae
commit 0df0e92ff0
2 changed files with 19 additions and 1 deletions

View File

@ -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);

View File

@ -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)
{