* 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
0.6.0-stable
Justin Clarke Casey 2008-05-25 01:09:14 +00:00
parent bc92d72828
commit 86c46e92cd
2 changed files with 29 additions and 21 deletions

View File

@ -1090,10 +1090,6 @@ namespace OpenSim.Region.Environment.Scenes
LLUUID folderID = LLUUID.Zero; LLUUID folderID = LLUUID.Zero;
foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
{ {
// m_log.DebugFormat( // m_log.DebugFormat(

View File

@ -270,11 +270,11 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_rootPart.Text; } get { return m_rootPart.Text; }
set { m_rootPart.Text = value; } set { m_rootPart.Text = value; }
} }
protected virtual bool InSceneBackup protected virtual bool InSceneBackup
{ {
get { return true; } get { return true; }
} }
public bool IsSelected public bool IsSelected
{ {
@ -402,7 +402,6 @@ namespace OpenSim.Region.Environment.Scenes
reader.Close(); reader.Close();
sr.Close(); sr.Close();
m_rootPart.LocalId = m_scene.PrimIDAllocate(); m_rootPart.LocalId = m_scene.PrimIDAllocate();
m_rootPart.ParentID = 0; m_rootPart.ParentID = 0;
m_rootPart.RegionHandle = m_regionHandle; m_rootPart.RegionHandle = m_regionHandle;
@ -521,9 +520,13 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (InSceneBackup) if (InSceneBackup)
{ {
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Attaching object {0} to scene presistence sweep", UUID);
m_scene.EventManager.OnBackup += ProcessBackup; m_scene.EventManager.OnBackup += ProcessBackup;
} }
} }
public LLVector3 GroupScale() public LLVector3 GroupScale()
{ {
LLVector3 minScale = new LLVector3(Constants.RegionSize,Constants.RegionSize,Constants.RegionSize); LLVector3 minScale = new LLVector3(Constants.RegionSize,Constants.RegionSize,Constants.RegionSize);
@ -1071,20 +1074,31 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="datastore"></param> /// <param name="datastore"></param>
public void ProcessBackup(IRegionDataStore datastore) public void ProcessBackup(IRegionDataStore datastore)
{ {
// don't backup while it's selected or you're asking for changes mid stream. // don't backup while it's selected or you're asking for changes mid stream.
if (HasGroupChanged && !IsSelected) if (HasGroupChanged)
{ {
m_log.InfoFormat("[SCENE]: STORING OBJECT {0}", UUID); // 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
SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); // they are no longer selected in the client.
// if (!IsSelected)
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); // {
HasGroupChanged = false; 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.ForEachPart(delegate(SceneObjectPart part) { part.ProcessInventoryBackup(datastore); });
backup_group = null; 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? // Why is storing the inventory outside of HasGroupChanged?
@ -1207,9 +1221,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
SetRootPartOwner(m_rootPart, cAgentID, cGroupID); SetRootPartOwner(m_rootPart, cAgentID, cGroupID);
m_rootPart.ScheduleFullUpdate(); m_rootPart.ScheduleFullUpdate();
} }
List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values); List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)