diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index a351271..7839394 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | |||
@@ -237,6 +237,73 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
237 | // TestHelpers.DisableLogging(); | 237 | // TestHelpers.DisableLogging(); |
238 | } | 238 | } |
239 | 239 | ||
240 | /// <summary> | ||
241 | /// Test teleport procedures when the target simulator returns false when queried about access. | ||
242 | /// </summary> | ||
243 | [Test] | ||
244 | public void TestSameSimulatorSeparatedRegionsCreateAgentFails() | ||
245 | { | ||
246 | TestHelpers.InMethod(); | ||
247 | // TestHelpers.EnableLogging(); | ||
248 | |||
249 | UUID userId = TestHelpers.ParseTail(0x1); | ||
250 | Vector3 preTeleportPosition = new Vector3(30, 31, 32); | ||
251 | |||
252 | EntityTransferModule etm = new EntityTransferModule(); | ||
253 | LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule(); | ||
254 | |||
255 | IConfigSource config = new IniConfigSource(); | ||
256 | config.AddConfig("Modules"); | ||
257 | config.Configs["Modules"].Set("EntityTransferModule", etm.Name); | ||
258 | config.Configs["Modules"].Set("SimulationServices", lscm.Name); | ||
259 | |||
260 | config.AddConfig("EntityTransfer"); | ||
261 | |||
262 | // In order to run a single threaded regression test we do not want the entity transfer module waiting | ||
263 | // for a callback from the destination scene before removing its avatar data. | ||
264 | config.Configs["EntityTransfer"].Set("wait_for_callback", false); | ||
265 | |||
266 | SceneHelpers sh = new SceneHelpers(); | ||
267 | TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000); | ||
268 | TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000); | ||
269 | |||
270 | // Shared scene modules | ||
271 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, etm, lscm); | ||
272 | |||
273 | Vector3 teleportPosition = new Vector3(10, 11, 12); | ||
274 | Vector3 teleportLookAt = new Vector3(20, 21, 22); | ||
275 | |||
276 | ScenePresence sp = SceneHelpers.AddScenePresence(sceneA, userId, sh.SceneManager); | ||
277 | sp.AbsolutePosition = preTeleportPosition; | ||
278 | |||
279 | // Make sceneB refuse CreateAgent | ||
280 | sceneB.LoginsDisabled = true; | ||
281 | |||
282 | sceneA.RequestTeleportLocation( | ||
283 | sp.ControllingClient, | ||
284 | sceneB.RegionInfo.RegionHandle, | ||
285 | teleportPosition, | ||
286 | teleportLookAt, | ||
287 | (uint)TeleportFlags.ViaLocation); | ||
288 | |||
289 | // ((TestClient)sp.ControllingClient).CompleteTeleportClientSide(); | ||
290 | |||
291 | Assert.That(sceneB.GetScenePresence(userId), Is.Null); | ||
292 | |||
293 | ScenePresence sceneASp = sceneA.GetScenePresence(userId); | ||
294 | Assert.That(sceneASp, Is.Not.Null); | ||
295 | Assert.That(sceneASp.Scene.RegionInfo.RegionName, Is.EqualTo(sceneA.RegionInfo.RegionName)); | ||
296 | Assert.That(sceneASp.AbsolutePosition, Is.EqualTo(preTeleportPosition)); | ||
297 | |||
298 | // TODO: Add assertions to check correct circuit details in both scenes. | ||
299 | |||
300 | // Lookat is sent to the client only - sp.Lookat does not yield the same thing (calculation from camera | ||
301 | // position instead). | ||
302 | // Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt)); | ||
303 | |||
304 | // TestHelpers.DisableLogging(); | ||
305 | } | ||
306 | |||
240 | [Test] | 307 | [Test] |
241 | public void TestSameSimulatorNeighbouringRegionsTeleport() | 308 | public void TestSameSimulatorNeighbouringRegionsTeleport() |
242 | { | 309 | { |