aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-09-07 00:34:06 +0100
committerMelanie2010-09-07 01:43:20 +0100
commit3d033520fafa1431c52086d741d1f3c7409bc6eb (patch)
treef16956aa3d2cac3ae325ffda621f2bd79b40310e /OpenSim/Region/Framework/Scenes/Scene.cs
parentAdd test that checks correct persistence when an unlink is quickly followed b... (diff)
downloadopensim-SC-3d033520fafa1431c52086d741d1f3c7409bc6eb.zip
opensim-SC-3d033520fafa1431c52086d741d1f3c7409bc6eb.tar.gz
opensim-SC-3d033520fafa1431c52086d741d1f3c7409bc6eb.tar.bz2
opensim-SC-3d033520fafa1431c52086d741d1f3c7409bc6eb.tar.xz
Fix deletion persistence when freshly delinked prims are removed
Previously, Scene.Inventory.DeRezObjects() forced the persistence of prims before deletion. This is necessary so that freshly delinked prims can be deleted (otherwise they remain as parts of their old group and reappear on server restart). However, DeRezObjects() deleted to user inventory, which is not required by llDie() or direct region module unlink and deletion. Therefore, forced persistence has been pushed down into Scene.UnlinkSceneObject() to be more general, this is still on the DeRezObjects() path. Uncommented TestDelinkPersistence() since this now passes. Tests required considerable elaboration of MockRegionDataPlugin to reflect underlying storing of parts.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs25
1 files changed, 16 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 183310d..82e7d76 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2092,7 +2092,7 @@ namespace OpenSim.Region.Framework.Scenes
2092// rootPart.PhysActor = null; 2092// rootPart.PhysActor = null;
2093// } 2093// }
2094 2094
2095 if (UnlinkSceneObject(group.UUID, false)) 2095 if (UnlinkSceneObject(group, false))
2096 { 2096 {
2097 EventManager.TriggerObjectBeingRemovedFromScene(group); 2097 EventManager.TriggerObjectBeingRemovedFromScene(group);
2098 EventManager.TriggerParcelPrimCountTainted(); 2098 EventManager.TriggerParcelPrimCountTainted();
@@ -2107,18 +2107,25 @@ namespace OpenSim.Region.Framework.Scenes
2107 /// Unlink the given object from the scene. Unlike delete, this just removes the record of the object - the 2107 /// Unlink the given object from the scene. Unlike delete, this just removes the record of the object - the
2108 /// object itself is not destroyed. 2108 /// object itself is not destroyed.
2109 /// </summary> 2109 /// </summary>
2110 /// <param name="uuid">Id of object.</param> 2110 /// <param name="so">The scene object.</param>
2111 /// <param name="softDelete">If true, only deletes from scene, but keeps the object in the database.</param>
2111 /// <returns>true if the object was in the scene, false if it was not</returns> 2112 /// <returns>true if the object was in the scene, false if it was not</returns>
2112 /// <param name="softDelete">If true, only deletes from scene, but keeps object in database.</param> 2113 public bool UnlinkSceneObject(SceneObjectGroup so, bool softDelete)
2113 public bool UnlinkSceneObject(UUID uuid, bool softDelete)
2114 { 2114 {
2115 if (m_sceneGraph.DeleteSceneObject(uuid, softDelete)) 2115 if (m_sceneGraph.DeleteSceneObject(so.UUID, softDelete))
2116 { 2116 {
2117 if (!softDelete) 2117 if (!softDelete)
2118 { 2118 {
2119 m_storageManager.DataStore.RemoveObject(uuid, 2119 // Force a database update so that the scene object group ID is accurate. It's possible that the
2120 m_regInfo.RegionID); 2120 // group has recently been delinked from another group but that this change has not been persisted
2121 // to the DB.
2122 ForceSceneObjectBackup(so);
2123 so.DetachFromBackup();
2124 m_storageManager.DataStore.RemoveObject(so.UUID, m_regInfo.RegionID);
2121 } 2125 }
2126
2127 // We need to keep track of this state in case this group is still queued for further backup.
2128 so.IsDeleted = true;
2122 2129
2123 return true; 2130 return true;
2124 } 2131 }
@@ -2149,7 +2156,7 @@ namespace OpenSim.Region.Framework.Scenes
2149 } 2156 }
2150 catch (Exception) 2157 catch (Exception)
2151 { 2158 {
2152 m_log.Warn("[DATABASE]: exception when trying to remove the prim that crossed the border."); 2159 m_log.Warn("[SCENE]: exception when trying to remove the prim that crossed the border.");
2153 } 2160 }
2154 return; 2161 return;
2155 } 2162 }
@@ -2166,7 +2173,7 @@ namespace OpenSim.Region.Framework.Scenes
2166 } 2173 }
2167 catch (Exception) 2174 catch (Exception)
2168 { 2175 {
2169 m_log.Warn("[DATABASE]: exception when trying to return the prim that crossed the border."); 2176 m_log.Warn("[SCENE]: exception when trying to return the prim that crossed the border.");
2170 } 2177 }
2171 return; 2178 return;
2172 } 2179 }