diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index dc20f13..bdd9093 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs | |||
@@ -532,6 +532,31 @@ namespace OpenSim.Tests.Common | |||
532 | /// <returns></returns> | 532 | /// <returns></returns> |
533 | public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData, SceneManager sceneManager) | 533 | public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData, SceneManager sceneManager) |
534 | { | 534 | { |
535 | return AddScenePresence(scene, new TestClient(agentData, scene, sceneManager), agentData, sceneManager); | ||
536 | } | ||
537 | |||
538 | /// <summary> | ||
539 | /// Add a root agent. | ||
540 | /// </summary> | ||
541 | /// <remarks> | ||
542 | /// This function | ||
543 | /// | ||
544 | /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the | ||
545 | /// userserver if grid) would give initial login data back to the client and separately tell the scene that the | ||
546 | /// agent was coming. | ||
547 | /// | ||
548 | /// 2) Connects the agent with the scene | ||
549 | /// | ||
550 | /// This function performs actions equivalent with notifying the scene that an agent is | ||
551 | /// coming and then actually connecting the agent to the scene. The one step missed out is the very first | ||
552 | /// </remarks> | ||
553 | /// <param name="scene"></param> | ||
554 | /// <param name="agentData"></param> | ||
555 | /// <param name="sceneManager"></param> | ||
556 | /// <returns></returns> | ||
557 | public static ScenePresence AddScenePresence( | ||
558 | Scene scene, IClientAPI client, AgentCircuitData agentData, SceneManager sceneManager) | ||
559 | { | ||
535 | // We emulate the proper login sequence here by doing things in four stages | 560 | // We emulate the proper login sequence here by doing things in four stages |
536 | 561 | ||
537 | // Stage 0: login | 562 | // Stage 0: login |
@@ -541,7 +566,7 @@ namespace OpenSim.Tests.Common | |||
541 | lpsc.m_PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID); | 566 | lpsc.m_PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID); |
542 | 567 | ||
543 | // Stages 1 & 2 | 568 | // Stages 1 & 2 |
544 | ScenePresence sp = IntroduceClientToScene(scene, sceneManager, agentData, TeleportFlags.ViaLogin); | 569 | ScenePresence sp = IntroduceClientToScene(scene, client, agentData, TeleportFlags.ViaLogin); |
545 | 570 | ||
546 | // Stage 3: Complete the entrance into the region. This converts the child agent into a root agent. | 571 | // Stage 3: Complete the entrance into the region. This converts the child agent into a root agent. |
547 | sp.CompleteMovement(sp.ControllingClient, true); | 572 | sp.CompleteMovement(sp.ControllingClient, true); |
@@ -558,11 +583,11 @@ namespace OpenSim.Tests.Common | |||
558 | /// neighbours and where no teleporting takes place. | 583 | /// neighbours and where no teleporting takes place. |
559 | /// </param> | 584 | /// </param> |
560 | /// <param name='scene'></param> | 585 | /// <param name='scene'></param> |
561 | /// <param name='sceneManager></param> | 586 | /// <param name='testClient'></param> |
562 | /// <param name='agentData'></param> | 587 | /// <param name='agentData'></param> |
563 | /// <param name='tf'></param> | 588 | /// <param name='tf'></param> |
564 | private static ScenePresence IntroduceClientToScene( | 589 | private static ScenePresence IntroduceClientToScene( |
565 | Scene scene, SceneManager sceneManager, AgentCircuitData agentData, TeleportFlags tf) | 590 | Scene scene, IClientAPI client, AgentCircuitData agentData, TeleportFlags tf) |
566 | { | 591 | { |
567 | string reason; | 592 | string reason; |
568 | 593 | ||
@@ -571,10 +596,9 @@ namespace OpenSim.Tests.Common | |||
571 | Console.WriteLine("NewUserConnection failed: " + reason); | 596 | Console.WriteLine("NewUserConnection failed: " + reason); |
572 | 597 | ||
573 | // Stage 2: add the new client as a child agent to the scene | 598 | // Stage 2: add the new client as a child agent to the scene |
574 | TestClient client = new TestClient(agentData, scene, sceneManager); | ||
575 | scene.AddNewClient(client, PresenceType.User); | 599 | scene.AddNewClient(client, PresenceType.User); |
576 | 600 | ||
577 | return scene.GetScenePresence(agentData.AgentID); | 601 | return scene.GetScenePresence(client.AgentId); |
578 | } | 602 | } |
579 | 603 | ||
580 | public static ScenePresence AddChildScenePresence(Scene scene, UUID agentId) | 604 | public static ScenePresence AddChildScenePresence(Scene scene, UUID agentId) |
@@ -583,7 +607,8 @@ namespace OpenSim.Tests.Common | |||
583 | acd.child = true; | 607 | acd.child = true; |
584 | 608 | ||
585 | // XXX: ViaLogin may not be correct for child agents | 609 | // XXX: ViaLogin may not be correct for child agents |
586 | return IntroduceClientToScene(scene, null, acd, TeleportFlags.ViaLogin); | 610 | TestClient client = new TestClient(acd, scene, null); |
611 | return IntroduceClientToScene(scene, client, acd, TeleportFlags.ViaLogin); | ||
587 | } | 612 | } |
588 | 613 | ||
589 | /// <summary> | 614 | /// <summary> |