Only send one kill object to the deleter when they derez an object rather than two.
Extend regression test to check this.user_profiles
parent
3290cd09d3
commit
b4a6f2195d
|
@ -104,14 +104,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// better than losing the object for now.
|
||||
if (permissionToDelete)
|
||||
{
|
||||
List<uint> killIDs = new List<uint>();
|
||||
|
||||
foreach (SceneObjectGroup g in objectGroups)
|
||||
{ killIDs.Add(g.LocalId);
|
||||
g.DeleteGroupFromScene(true);
|
||||
}
|
||||
|
||||
m_scene.SendKillObject(killIDs);
|
||||
g.DeleteGroupFromScene(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,7 +154,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (x.permissionToDelete)
|
||||
{
|
||||
foreach (SceneObjectGroup g in x.objectGroups)
|
||||
m_scene.DeleteSceneObject(g, false);
|
||||
m_scene.DeleteSceneObject(g, true);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -84,30 +84,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
|
||||
TestScene scene = new SceneHelpers().SetupScene();
|
||||
SceneHelpers.SetupSceneModules(scene, new PermissionsModule());
|
||||
IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||
TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||
|
||||
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
||||
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
||||
sogd.Enabled = false;
|
||||
|
||||
SceneObjectPart part
|
||||
= new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
|
||||
part.Name = "obj1";
|
||||
scene.AddNewSceneObject(new SceneObjectGroup(part), false);
|
||||
|
||||
SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", userId);
|
||||
uint soLocalId = so.LocalId;
|
||||
|
||||
List<uint> localIds = new List<uint>();
|
||||
localIds.Add(part.LocalId);
|
||||
localIds.Add(so.LocalId);
|
||||
scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
|
||||
|
||||
// Check that object isn't deleted until we crank the sogd handle.
|
||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId);
|
||||
Assert.That(retrievedPart, Is.Not.Null);
|
||||
Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False);
|
||||
|
||||
sogd.InventoryDeQueueAndDelete();
|
||||
|
||||
SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId);
|
||||
SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId);
|
||||
Assert.That(retrievedPart2, Is.Null);
|
||||
|
||||
Assert.That(client.ReceivedKills.Count, Is.EqualTo(1));
|
||||
Assert.That(client.ReceivedKills[0], Is.EqualTo(soLocalId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue