aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-03 18:48:04 +0000
committerJustin Clarke Casey2009-02-03 18:48:04 +0000
commitb2de0a3ae6e49e07d6f658ec55b8260ab5748627 (patch)
treebe4142ed318cd83f56b71fa2f5b0aced78f355bc /OpenSim/Region/Environment
parent* Lock parts while they're being duplicated to prevent possible race conditio... (diff)
downloadopensim-SC-b2de0a3ae6e49e07d6f658ec55b8260ab5748627.zip
opensim-SC-b2de0a3ae6e49e07d6f658ec55b8260ab5748627.tar.gz
opensim-SC-b2de0a3ae6e49e07d6f658ec55b8260ab5748627.tar.bz2
opensim-SC-b2de0a3ae6e49e07d6f658ec55b8260ab5748627.tar.xz
* 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
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs17
2 files changed, 12 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index c3e3dfc..6388bc1 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -2049,15 +2049,11 @@ namespace OpenSim.Region.Environment.Scenes
2049 } 2049 }
2050 2050
2051 m_scene.UnlinkSceneObject(objectGroup.UUID, true); 2051 m_scene.UnlinkSceneObject(objectGroup.UUID, true);
2052// objectGroup.Children.Clear(); 2052 objectGroup.Children.Clear();
2053
2054 // Can't do this yet since backup still makes use of the root part without any synchronization
2053// objectGroup.m_rootPart = null; 2055// objectGroup.m_rootPart = null;
2054 2056
2055 // TODO Deleting the original group object may cause problems later on if they have already
2056 // made it into the update queue. However, sending out updates for those parts is now
2057 // spurious, so it would be good not to send them at some point.
2058 // The traffic caused is always going to be pretty minor, so it's not high priority
2059 //objectGroup.DeleteGroup();
2060
2061 AttachToBackup(); 2057 AttachToBackup();
2062 HasGroupChanged = true; 2058 HasGroupChanged = true;
2063 ScheduleGroupForFullUpdate(); 2059 ScheduleGroupForFullUpdate();
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
index ed2eb79..5e5f5c2 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
131 // FIXME: Can't to these tests yet since group 2 still has the parts attached! We can't yet detach since 131 // FIXME: Can't to these tests yet since group 2 still has the parts attached! We can't yet detach since
132 // it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed. 132 // it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed.
133 //Assert.That(grp2.IsDeleted, "SOG 2 was not registered as deleted after link."); 133 //Assert.That(grp2.IsDeleted, "SOG 2 was not registered as deleted after link.");
134 //Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink."); 134 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink.");
135 Assert.That(grp1.Children.Count == 2); 135 Assert.That(grp1.Children.Count == 2);
136 136
137 if (debugtest) 137 if (debugtest)
@@ -173,6 +173,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
173 if (debugtest) 173 if (debugtest)
174 System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset); 174 System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset);
175 175
176 Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink.");
176 Assert.That(part2.AbsolutePosition == Vector3.Zero); 177 Assert.That(part2.AbsolutePosition == Vector3.Zero);
177 } 178 }
178 179
@@ -224,10 +225,11 @@ namespace OpenSim.Region.Environment.Scenes.Tests
224 grp1.RootPart.UpdateFlag = 0; 225 grp1.RootPart.UpdateFlag = 0;
225 grp3.RootPart.UpdateFlag = 0; 226 grp3.RootPart.UpdateFlag = 0;
226 227
227 // At this point we should have 4 parts total in two groups. 228 // At this point we should have 4 parts total in two groups.
228
229 Assert.That(grp1.Children.Count == 2); 229 Assert.That(grp1.Children.Count == 2);
230 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink.");
230 Assert.That(grp3.Children.Count == 2); 231 Assert.That(grp3.Children.Count == 2);
232 Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink.");
231 233
232 if (debugtest) 234 if (debugtest)
233 { 235 {
@@ -268,13 +270,12 @@ namespace OpenSim.Region.Environment.Scenes.Tests
268 270
269 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); 271 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f));
270 272
271 // Now we're linking the first group to the second group. This will make the first group child parts of the second one. 273 // Now we're linking the first group to the third group. This will make the first group child parts of the third one.
272 grp3.LinkToGroup(grp1); 274 grp3.LinkToGroup(grp1);
273 275
274 // Delink part 2 276 // Delink parts 2 and 3
275 grp1.DelinkFromGroup(part2.LocalId); 277 grp3.DelinkFromGroup(part2.LocalId);
276 278 grp3.DelinkFromGroup(part3.LocalId);
277 grp1.DelinkFromGroup(part3.LocalId);
278 279
279 if (debugtest) 280 if (debugtest)
280 { 281 {