diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs index 44c5a13..19ba5fa 100644 --- a/OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Environment/Scenes/AsyncSceneObjectGroupDeleter.cs | |||
@@ -42,6 +42,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
42 | public IClientAPI remoteClient; | 42 | public IClientAPI remoteClient; |
43 | public SceneObjectGroup objectGroup; | 43 | public SceneObjectGroup objectGroup; |
44 | public UUID folderID; | 44 | public UUID folderID; |
45 | public bool permissionToDelete; | ||
45 | } | 46 | } |
46 | 47 | ||
47 | /// <summary> | 48 | /// <summary> |
@@ -87,6 +88,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
87 | dtis.folderID = folderID; | 88 | dtis.folderID = folderID; |
88 | dtis.objectGroup = objectGroup; | 89 | dtis.objectGroup = objectGroup; |
89 | dtis.remoteClient = remoteClient; | 90 | dtis.remoteClient = remoteClient; |
91 | dtis.permissionToDelete = permissionToDelete; | ||
90 | 92 | ||
91 | m_inventoryDeletes.Enqueue(dtis); | 93 | m_inventoryDeletes.Enqueue(dtis); |
92 | } | 94 | } |
@@ -94,8 +96,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
94 | if (Enabled) | 96 | if (Enabled) |
95 | m_inventoryTicker.Start(); | 97 | m_inventoryTicker.Start(); |
96 | 98 | ||
99 | // Visually remove it, even if it isnt really gone yet. This means that if we crash before the object | ||
100 | // has gone to inventory, it will reappear in the region again on restart instead of being lost. | ||
101 | // This is not ideal since the object will still be available for manipulation when it should be, but it's | ||
102 | // better than losing the object for now. | ||
97 | if (permissionToDelete) | 103 | if (permissionToDelete) |
98 | m_scene.DeleteSceneObject(objectGroup, false); | 104 | objectGroup.DeleteGroup(false); |
99 | } | 105 | } |
100 | 106 | ||
101 | private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) | 107 | private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) |
@@ -126,7 +132,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
126 | 132 | ||
127 | try | 133 | try |
128 | { | 134 | { |
129 | m_scene.DeleteToInventory(x.destination, x.folderID, x.objectGroup, x.remoteClient); | 135 | m_scene.DeleteToInventory(x.destination, x.folderID, x.objectGroup, x.remoteClient); |
136 | if (x.permissionToDelete) | ||
137 | m_scene.DeleteSceneObject(x.objectGroup, false); | ||
130 | } | 138 | } |
131 | catch (Exception e) | 139 | catch (Exception e) |
132 | { | 140 | { |
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs index e0d6a99..1cc95fc 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs | |||
@@ -97,8 +97,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
97 | IClientAPI client = SceneTestUtils.AddRootAgent(scene, agentId); | 97 | IClientAPI client = SceneTestUtils.AddRootAgent(scene, agentId); |
98 | scene.DeRezObject(client, part.LocalId, UUID.Zero, 9, UUID.Zero); | 98 | scene.DeRezObject(client, part.LocalId, UUID.Zero, 9, UUID.Zero); |
99 | 99 | ||
100 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 100 | SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); |
101 | Assert.That(retrievedPart, Is.Null); | 101 | Assert.That(retrievedPart, Is.Not.Null); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | } \ No newline at end of file | 104 | } \ No newline at end of file |