diff options
author | Justin Clark-Casey (justincc) | 2010-09-07 00:34:06 +0100 |
---|---|---|
committer | Melanie | 2010-09-07 01:43:20 +0100 |
commit | 3d033520fafa1431c52086d741d1f3c7409bc6eb (patch) | |
tree | f16956aa3d2cac3ae325ffda621f2bd79b40310e /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | Add test that checks correct persistence when an unlink is quickly followed b... (diff) | |
download | opensim-SC_OLD-3d033520fafa1431c52086d741d1f3c7409bc6eb.zip opensim-SC_OLD-3d033520fafa1431c52086d741d1f3c7409bc6eb.tar.gz opensim-SC_OLD-3d033520fafa1431c52086d741d1f3c7409bc6eb.tar.bz2 opensim-SC_OLD-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/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index b8b3db5..09e3e0e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1226,16 +1226,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1226 | } | 1226 | } |
1227 | 1227 | ||
1228 | /// <summary> | 1228 | /// <summary> |
1229 | /// Delete this group from its scene and tell all the scene presences about that deletion. | 1229 | /// Delete this group from its scene. |
1230 | /// </summary> | 1230 | /// </summary> |
1231 | /// <param name="silent">Broadcast deletions to all clients.</param> | 1231 | /// |
1232 | /// This only handles the in-world consequences of deletion (e.g. any avatars sitting on it are forcibly stood | ||
1233 | /// up and all avatars receive notification of its removal. Removal of the scene object from database backup | ||
1234 | /// must be handled by the caller. | ||
1235 | /// | ||
1236 | /// <param name="silent">If true then deletion is not broadcast to clients</param> | ||
1232 | public void DeleteGroup(bool silent) | 1237 | public void DeleteGroup(bool silent) |
1233 | { | 1238 | { |
1234 | // We need to keep track of this state in case this group is still queued for backup. | ||
1235 | m_isDeleted = true; | ||
1236 | |||
1237 | DetachFromBackup(); | ||
1238 | |||
1239 | lock (m_parts) | 1239 | lock (m_parts) |
1240 | { | 1240 | { |
1241 | foreach (SceneObjectPart part in m_parts.Values) | 1241 | foreach (SceneObjectPart part in m_parts.Values) |
@@ -1381,10 +1381,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1381 | public virtual void ProcessBackup(IRegionDataStore datastore, bool forcedBackup) | 1381 | public virtual void ProcessBackup(IRegionDataStore datastore, bool forcedBackup) |
1382 | { | 1382 | { |
1383 | if (!m_isBackedUp) | 1383 | if (!m_isBackedUp) |
1384 | { | ||
1385 | // m_log.DebugFormat( | ||
1386 | // "[WATER WARS]: Ignoring backup of {0} {1} since object is not marked to be backed up", Name, UUID); | ||
1384 | return; | 1387 | return; |
1388 | } | ||
1385 | 1389 | ||
1386 | if (IsDeleted || UUID == UUID.Zero) | 1390 | if (IsDeleted || UUID == UUID.Zero) |
1391 | { | ||
1392 | // m_log.DebugFormat( | ||
1393 | // "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID); | ||
1387 | return; | 1394 | return; |
1395 | } | ||
1388 | 1396 | ||
1389 | // Since this is the top of the section of call stack for backing up a particular scene object, don't let | 1397 | // Since this is the top of the section of call stack for backing up a particular scene object, don't let |
1390 | // any exception propogate upwards. | 1398 | // any exception propogate upwards. |
@@ -1420,7 +1428,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1420 | if (HasGroupChanged) | 1428 | if (HasGroupChanged) |
1421 | { | 1429 | { |
1422 | // don't backup while it's selected or you're asking for changes mid stream. | 1430 | // don't backup while it's selected or you're asking for changes mid stream. |
1423 | if ((isTimeToPersist()) || (forcedBackup)) | 1431 | if (isTimeToPersist() || forcedBackup) |
1424 | { | 1432 | { |
1425 | m_log.DebugFormat( | 1433 | m_log.DebugFormat( |
1426 | "[SCENE]: Storing {0}, {1} in {2}", | 1434 | "[SCENE]: Storing {0}, {1} in {2}", |
@@ -1443,19 +1451,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1443 | 1451 | ||
1444 | backup_group = null; | 1452 | backup_group = null; |
1445 | } | 1453 | } |
1446 | // else | 1454 | // else |
1447 | // { | 1455 | // { |
1448 | // m_log.DebugFormat( | 1456 | // m_log.DebugFormat( |
1449 | // "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}", | 1457 | // "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}", |
1450 | // Name, UUID, IsSelected); | 1458 | // Name, UUID, IsSelected); |
1451 | // } | 1459 | // } |
1452 | } | 1460 | } |
1453 | } | 1461 | } |
1454 | catch (Exception e) | 1462 | catch (Exception e) |
1455 | { | 1463 | { |
1456 | m_log.ErrorFormat( | 1464 | m_log.ErrorFormat( |
1457 | "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}\n\t{4}", | 1465 | "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}", |
1458 | Name, UUID, m_scene.RegionInfo.RegionName, e, e.StackTrace); | 1466 | Name, UUID, m_scene.RegionInfo.RegionName, e.Message, e.StackTrace); |
1459 | } | 1467 | } |
1460 | } | 1468 | } |
1461 | 1469 | ||
@@ -2245,7 +2253,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2245 | } | 2253 | } |
2246 | } | 2254 | } |
2247 | 2255 | ||
2248 | m_scene.UnlinkSceneObject(objectGroup.UUID, true); | 2256 | m_scene.UnlinkSceneObject(objectGroup, true); |
2249 | objectGroup.m_isDeleted = true; | 2257 | objectGroup.m_isDeleted = true; |
2250 | 2258 | ||
2251 | lock (objectGroup.m_parts) | 2259 | lock (objectGroup.m_parts) |