From 7a274a7e1dfa651c17cb33ca1994f321ccddc005 Mon Sep 17 00:00:00 2001 From: diva Date: Thu, 12 Feb 2009 23:23:44 +0000 Subject: 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! --- .../Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs') 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 scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000, cm); scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000, cm); - IRegionModule interregionComms = new RESTInterregionComms(); - interregionComms.Initialise(scene, new IniConfigSource()); - interregionComms.Initialise(scene2, new IniConfigSource()); - interregionComms.Initialise(scene3, new IniConfigSource()); - interregionComms.PostInitialise(); + IRegionModule interregionComms = new RESTInterregionComms(); + interregionComms.Initialise(scene, new IniConfigSource()); + interregionComms.Initialise(scene2, new IniConfigSource()); + interregionComms.Initialise(scene3, new IniConfigSource()); + interregionComms.PostInitialise(); SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms); SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms); SceneSetupHelpers.SetupSceneModules(scene3, new IniConfigSource(), interregionComms); @@ -203,6 +203,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests scene.RegisterRegionWithGrid(); scene2.RegisterRegionWithGrid(); presence.Update(); + // Crossings are asynchronous + while (presence.IsInTransit) { } ; Assert.That(presence.IsChildAgent, Is.True, "Did not complete region cross as expected."); Assert.That(presence2.IsChildAgent, Is.False, "Did not receive root status after receiving agent."); @@ -210,6 +212,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Cross Back presence2.AbsolutePosition = new Vector3(-1, 3, 100); presence2.Update(); + // Crossings are asynchronous + while (presence.IsInTransit) { }; Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected."); Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); -- cgit v1.1