aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-05-09 18:53:34 +0100
committerJustin Clark-Casey (justincc)2013-05-09 18:53:34 +0100
commitb4a6f2195d6d1a3a5f91715f7badf4cc983f7689 (patch)
tree508431b5b41666d278e4f9e827fee05ffe4eba94 /OpenSim/Region/Framework
parentremove pointless region handle paramter from IClientAPI.SendKillObject() (diff)
downloadopensim-SC_OLD-b4a6f2195d6d1a3a5f91715f7badf4cc983f7689.zip
opensim-SC_OLD-b4a6f2195d6d1a3a5f91715f7badf4cc983f7689.tar.gz
opensim-SC_OLD-b4a6f2195d6d1a3a5f91715f7badf4cc983f7689.tar.bz2
opensim-SC_OLD-b4a6f2195d6d1a3a5f91715f7badf4cc983f7689.tar.xz
Only send one kill object to the deleter when they derez an object rather than two.
Extend regression test to check this.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs19
2 files changed, 12 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index f555b49..11a0146 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -104,14 +104,8 @@ namespace OpenSim.Region.Framework.Scenes
104 // better than losing the object for now. 104 // better than losing the object for now.
105 if (permissionToDelete) 105 if (permissionToDelete)
106 { 106 {
107 List<uint> killIDs = new List<uint>();
108
109 foreach (SceneObjectGroup g in objectGroups) 107 foreach (SceneObjectGroup g in objectGroups)
110 { killIDs.Add(g.LocalId); 108 g.DeleteGroupFromScene(false);
111 g.DeleteGroupFromScene(true);
112 }
113
114 m_scene.SendKillObject(killIDs);
115 } 109 }
116 } 110 }
117 111
@@ -160,7 +154,7 @@ namespace OpenSim.Region.Framework.Scenes
160 if (x.permissionToDelete) 154 if (x.permissionToDelete)
161 { 155 {
162 foreach (SceneObjectGroup g in x.objectGroups) 156 foreach (SceneObjectGroup g in x.objectGroups)
163 m_scene.DeleteSceneObject(g, false); 157 m_scene.DeleteSceneObject(g, true);
164 } 158 }
165 } 159 }
166 catch (Exception e) 160 catch (Exception e)
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index f738ff1..d670dad 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -84,30 +84,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests
84 84
85 TestScene scene = new SceneHelpers().SetupScene(); 85 TestScene scene = new SceneHelpers().SetupScene();
86 SceneHelpers.SetupSceneModules(scene, new PermissionsModule()); 86 SceneHelpers.SetupSceneModules(scene, new PermissionsModule());
87 IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; 87 TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
88 88
89 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 89 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
90 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 90 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
91 sogd.Enabled = false; 91 sogd.Enabled = false;
92 92
93 SceneObjectPart part 93 SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", userId);
94 = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); 94 uint soLocalId = so.LocalId;
95 part.Name = "obj1";
96 scene.AddNewSceneObject(new SceneObjectGroup(part), false);
97 95
98 List<uint> localIds = new List<uint>(); 96 List<uint> localIds = new List<uint>();
99 localIds.Add(part.LocalId); 97 localIds.Add(so.LocalId);
100 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); 98 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
101 99
102 // Check that object isn't deleted until we crank the sogd handle. 100 // Check that object isn't deleted until we crank the sogd handle.
103 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 101 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId);
104 Assert.That(retrievedPart, Is.Not.Null); 102 Assert.That(retrievedPart, Is.Not.Null);
105 Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); 103 Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False);
106 104
107 sogd.InventoryDeQueueAndDelete(); 105 sogd.InventoryDeQueueAndDelete();
108 106
109 SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); 107 SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId);
110 Assert.That(retrievedPart2, Is.Null); 108 Assert.That(retrievedPart2, Is.Null);
109
110 Assert.That(client.ReceivedKills.Count, Is.EqualTo(1));
111 Assert.That(client.ReceivedKills[0], Is.EqualTo(soLocalId));
111 } 112 }
112 113
113 /// <summary> 114 /// <summary>