* Stop the HasGroupChanged flag being reverted for newly restored prims which need to be persisted to the db

* This should stop the problem where linked prims loaded via an archive did not survive server restart
* It may address mantis 1819 though the symptoms don't look consistent
0.6.0-stable
Justin Clarke Casey 2008-07-25 17:48:58 +00:00
parent c724e38433
commit d954f46a0a
3 changed files with 27 additions and 26 deletions

View File

@ -512,8 +512,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (InSceneBackup) if (InSceneBackup)
{ {
// m_log.DebugFormat( //m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Attaching object {0} to scene presistence sweep", UUID); // "[SCENE OBJECT GROUP]: Attaching object {0} {1} to scene presistence sweep", Name, UUID);
m_scene.EventManager.OnBackup += ProcessBackup; m_scene.EventManager.OnBackup += ProcessBackup;
} }
@ -873,11 +873,15 @@ namespace OpenSim.Region.Environment.Scenes
return m_scene.MaxUndoCount; return m_scene.MaxUndoCount;
return 5; return 5;
} }
public void ResetChildPrimPhysicsPositions()
{ // justincc: I don't believe this hack is needed any longer, especially since the physics
AbsolutePosition = AbsolutePosition; // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false
HasGroupChanged = false; // this method was preventing proper reload of scene objects.
} //public void ResetChildPrimPhysicsPositions()
//{
// AbsolutePosition = AbsolutePosition;
// HasGroupChanged = false;
//}
public LLUUID GetPartsFullID(uint localID) public LLUUID GetPartsFullID(uint localID)
{ {
@ -1061,8 +1065,9 @@ namespace OpenSim.Region.Environment.Scenes
{ {
part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim);
} }
// Hack to get the physics scene geometries in the right spot // Hack to get the physics scene geometries in the right spot
ResetChildPrimPhysicsPositions(); //ResetChildPrimPhysicsPositions();
} }
} }
else else
@ -1096,14 +1101,14 @@ namespace OpenSim.Region.Environment.Scenes
/// <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.
if (HasGroupChanged) if (HasGroupChanged)
{ {
// don't backup while it's selected or you're asking for changes mid stream.
if ((!IsSelected) && (RootPart != null)) if ((!IsSelected) && (RootPart != null))
{ {
m_log.InfoFormat( m_log.InfoFormat(
"[SCENE]: Storing object {0}, {1} in {2}", "[SCENE]: Storing object {0}, {1} in {2}",
m_rootPart.Name, UUID, m_scene.RegionInfo.RegionName); Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false);
@ -1117,14 +1122,10 @@ namespace OpenSim.Region.Environment.Scenes
// else // else
// { // {
// m_log.DebugFormat( // 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); // "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
// Name, UUID, IsSelected);
// } // }
} }
// Why is storing the inventory outside of HasGroupChanged?
//ForEachPart(delegate(SceneObjectPart part) { part.ProcessInventoryBackup(datastore); });
} }
#endregion #endregion

View File

@ -491,16 +491,16 @@ namespace OpenSim.Region.Environment.Scenes
{ {
StoreUndoState(); StoreUndoState();
m_offsetPosition = value; m_offsetPosition = value;
try //try
{ //{
// Hack to get the child prim to update world positions in the physics engine // Hack to get the child prim to update world positions in the physics engine
ParentGroup.ResetChildPrimPhysicsPositions(); // ParentGroup.ResetChildPrimPhysicsPositions();
} //}
catch (NullReferenceException) //catch (NullReferenceException)
{ //{
// Ignore, and skip over. // Ignore, and skip over.
} //}
//m_log.Info("[PART]: OFFSET:" + m_offsetPosition.ToString()); //m_log.Info("[PART]: OFFSET:" + m_offsetPosition.ToString());
} }
} }