From 86c46e92cd9df501f4bb906f8aed134b65f34cb2 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sun, 25 May 2008 01:09:14 +0000 Subject: * Disabling isSelected check on object persistence backup (at least temporarily), since it appears we sometimes either don't receive or don't register deselect packets when prims are shift copied. * A better long term solution may be to address the problem of why we're not always seeing the deselects --- .../Region/Environment/Scenes/Scene.Inventory.cs | 4 -- .../Region/Environment/Scenes/SceneObjectGroup.cs | 48 ++++++++++++++-------- 2 files changed, 30 insertions(+), 22 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 921770d..4d19d72 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -1090,10 +1090,6 @@ namespace OpenSim.Region.Environment.Scenes LLUUID folderID = LLUUID.Zero; - - - - foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) { // m_log.DebugFormat( diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 3407d4e..4484749 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -270,11 +270,11 @@ namespace OpenSim.Region.Environment.Scenes get { return m_rootPart.Text; } set { m_rootPart.Text = value; } } - + protected virtual bool InSceneBackup { get { return true; } - } + } public bool IsSelected { @@ -402,7 +402,6 @@ namespace OpenSim.Region.Environment.Scenes reader.Close(); sr.Close(); - m_rootPart.LocalId = m_scene.PrimIDAllocate(); m_rootPart.ParentID = 0; m_rootPart.RegionHandle = m_regionHandle; @@ -521,9 +520,13 @@ namespace OpenSim.Region.Environment.Scenes { if (InSceneBackup) { +// m_log.DebugFormat( +// "[SCENE OBJECT GROUP]: Attaching object {0} to scene presistence sweep", UUID); + m_scene.EventManager.OnBackup += ProcessBackup; } } + public LLVector3 GroupScale() { LLVector3 minScale = new LLVector3(Constants.RegionSize,Constants.RegionSize,Constants.RegionSize); @@ -1071,20 +1074,31 @@ namespace OpenSim.Region.Environment.Scenes /// /// public void ProcessBackup(IRegionDataStore datastore) - { + { // don't backup while it's selected or you're asking for changes mid stream. - if (HasGroupChanged && !IsSelected) - { - m_log.InfoFormat("[SCENE]: STORING OBJECT {0}", UUID); - - SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); - - datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); - HasGroupChanged = false; + if (HasGroupChanged) + { + // FIXME: Disabling this check temporarily since it seems that in some (as yet unidentified) + // circumstances with shift copy, we never register that some prims have been deselected, even though + // they are no longer selected in the client. +// if (!IsSelected) +// { + m_log.InfoFormat("[SCENE OBJECT GROUP]: Storing object {0}", UUID); + + SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); + + datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); + HasGroupChanged = false; - backup_group.ForEachPart(delegate(SceneObjectPart part) { part.ProcessInventoryBackup(datastore); }); - - backup_group = null; + backup_group.ForEachPart(delegate(SceneObjectPart part) { part.ProcessInventoryBackup(datastore); }); + + backup_group = null; +// } +// else +// { +// m_log.DebugFormat( +// "[SCENE OBJECT GROUP]: Did not update persistence of object {0} since it was still selected by an avatar during the backup sweep", UUID); +// } } // Why is storing the inventory outside of HasGroupChanged? @@ -1207,9 +1221,7 @@ namespace OpenSim.Region.Environment.Scenes { SetRootPartOwner(m_rootPart, cAgentID, cGroupID); m_rootPart.ScheduleFullUpdate(); - } - - + } List partList = new List(m_parts.Values); foreach (SceneObjectPart part in partList) -- cgit v1.1