* Now clearing parts list in the old group after a link has occurred

* Adjusted existing link tests to reflect this and added some new assertions
0.6.3-post-fixes
Justin Clarke Casey 2009-02-03 18:48:04 +00:00
parent 35f9f2545d
commit b2de0a3ae6
2 changed files with 12 additions and 15 deletions

View File

@ -2049,14 +2049,10 @@ namespace OpenSim.Region.Environment.Scenes
}
m_scene.UnlinkSceneObject(objectGroup.UUID, true);
// objectGroup.Children.Clear();
// objectGroup.m_rootPart = null;
objectGroup.Children.Clear();
// TODO Deleting the original group object may cause problems later on if they have already
// made it into the update queue. However, sending out updates for those parts is now
// spurious, so it would be good not to send them at some point.
// The traffic caused is always going to be pretty minor, so it's not high priority
//objectGroup.DeleteGroup();
// Can't do this yet since backup still makes use of the root part without any synchronization
// objectGroup.m_rootPart = null;
AttachToBackup();
HasGroupChanged = true;

View File

@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
// FIXME: Can't to these tests yet since group 2 still has the parts attached! We can't yet detach since
// it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed.
//Assert.That(grp2.IsDeleted, "SOG 2 was not registered as deleted after link.");
//Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink.");
Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink.");
Assert.That(grp1.Children.Count == 2);
if (debugtest)
@ -173,6 +173,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
if (debugtest)
System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset);
Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink.");
Assert.That(part2.AbsolutePosition == Vector3.Zero);
}
@ -225,9 +226,10 @@ namespace OpenSim.Region.Environment.Scenes.Tests
grp3.RootPart.UpdateFlag = 0;
// At this point we should have 4 parts total in two groups.
Assert.That(grp1.Children.Count == 2);
Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink.");
Assert.That(grp3.Children.Count == 2);
Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink.");
if (debugtest)
{
@ -268,13 +270,12 @@ namespace OpenSim.Region.Environment.Scenes.Tests
Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f));
// Now we're linking the first group to the second group. This will make the first group child parts of the second one.
// Now we're linking the first group to the third group. This will make the first group child parts of the third one.
grp3.LinkToGroup(grp1);
// Delink part 2
grp1.DelinkFromGroup(part2.LocalId);
grp1.DelinkFromGroup(part3.LocalId);
// Delink parts 2 and 3
grp3.DelinkFromGroup(part2.LocalId);
grp3.DelinkFromGroup(part3.LocalId);
if (debugtest)
{