diff options
Makes region crossings asynchronous. Moved the bulk of the original code out of ScenePresence and into SceneCommunicationService, where it should be (next to RequestTeleportToLocation). No changes in the crossing mechanism itself, yet. But this change opens the way to doing crossings as slowly as it needs to be, outside the simulator Update loop.
Note: weirdnesses may occur!
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index db88878..2f2bc19 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -66,11 +66,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
66 | scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000, cm); | 66 | scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000, cm); |
67 | scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000, cm); | 67 | scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000, cm); |
68 | 68 | ||
69 | IRegionModule interregionComms = new RESTInterregionComms(); | 69 | IRegionModule interregionComms = new RESTInterregionComms(); |
70 | interregionComms.Initialise(scene, new IniConfigSource()); | 70 | interregionComms.Initialise(scene, new IniConfigSource()); |
71 | interregionComms.Initialise(scene2, new IniConfigSource()); | 71 | interregionComms.Initialise(scene2, new IniConfigSource()); |
72 | interregionComms.Initialise(scene3, new IniConfigSource()); | 72 | interregionComms.Initialise(scene3, new IniConfigSource()); |
73 | interregionComms.PostInitialise(); | 73 | interregionComms.PostInitialise(); |
74 | SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms); | 74 | SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms); |
75 | SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms); | 75 | SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms); |
76 | SceneSetupHelpers.SetupSceneModules(scene3, new IniConfigSource(), interregionComms); | 76 | SceneSetupHelpers.SetupSceneModules(scene3, new IniConfigSource(), interregionComms); |
@@ -203,6 +203,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
203 | scene.RegisterRegionWithGrid(); | 203 | scene.RegisterRegionWithGrid(); |
204 | scene2.RegisterRegionWithGrid(); | 204 | scene2.RegisterRegionWithGrid(); |
205 | presence.Update(); | 205 | presence.Update(); |
206 | // Crossings are asynchronous | ||
207 | while (presence.IsInTransit) { } ; | ||
206 | 208 | ||
207 | Assert.That(presence.IsChildAgent, Is.True, "Did not complete region cross as expected."); | 209 | Assert.That(presence.IsChildAgent, Is.True, "Did not complete region cross as expected."); |
208 | Assert.That(presence2.IsChildAgent, Is.False, "Did not receive root status after receiving agent."); | 210 | Assert.That(presence2.IsChildAgent, Is.False, "Did not receive root status after receiving agent."); |
@@ -210,6 +212,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
210 | // Cross Back | 212 | // Cross Back |
211 | presence2.AbsolutePosition = new Vector3(-1, 3, 100); | 213 | presence2.AbsolutePosition = new Vector3(-1, 3, 100); |
212 | presence2.Update(); | 214 | presence2.Update(); |
215 | // Crossings are asynchronous | ||
216 | while (presence.IsInTransit) { }; | ||
213 | 217 | ||
214 | Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected."); | 218 | Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected."); |
215 | Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); | 219 | Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); |