aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Mock/TestClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tests/Common/Mock/TestClient.cs')
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs29
1 files changed, 4 insertions, 25 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index e892a53..4a1380d 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -46,8 +46,6 @@ namespace OpenSim.Tests.Common.Mock
46 46
47 EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); 47 EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing");
48 48
49 private TestClient TeleportSceneClient;
50
51 private Scene m_scene; 49 private Scene m_scene;
52 private SceneManager m_sceneManager; 50 private SceneManager m_sceneManager;
53 51
@@ -60,7 +58,9 @@ namespace OpenSim.Tests.Common.Mock
60 public List<ImagePacketPacket> SentImagePacketPackets { get; private set; } 58 public List<ImagePacketPacket> SentImagePacketPackets { get; private set; }
61 public List<ImageNotInDatabasePacket> SentImageNotInDatabasePackets { get; private set; } 59 public List<ImageNotInDatabasePacket> SentImageNotInDatabasePackets { get; private set; }
62 60
61 // Test client specific events - for use by tests to implement some IClientAPI behaviour.
63 public event Action<RegionInfo, Vector3, Vector3> OnReceivedMoveAgentIntoRegion; 62 public event Action<RegionInfo, Vector3, Vector3> OnReceivedMoveAgentIntoRegion;
63 public event Action<ulong, IPEndPoint> OnTestClientInformClientOfNeighbour;
64 64
65// disable warning: public events, part of the public API 65// disable warning: public events, part of the public API
66#pragma warning disable 67 66#pragma warning disable 67
@@ -604,23 +604,8 @@ namespace OpenSim.Tests.Common.Mock
604 604
605 public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) 605 public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint)
606 { 606 {
607 m_log.DebugFormat("[TEST CLIENT]: Processing inform client of neighbour"); 607 if (OnTestClientInformClientOfNeighbour != null)
608 608 OnTestClientInformClientOfNeighbour(neighbourHandle, neighbourExternalEndPoint);
609 // In response to this message, we are going to make a teleport to the scene we've previous been told
610 // about by test code (this needs to be improved).
611 AgentCircuitData newAgent = RequestClientInfo();
612
613 // Stage 2: add the new client as a child agent to the scene
614 uint x, y;
615 Utils.LongToUInts(neighbourHandle, out x, out y);
616 x /= Constants.RegionSize;
617 y /= Constants.RegionSize;
618
619 Scene neighbourScene;
620 m_sceneManager.TryGetScene(x, y, out neighbourScene);
621
622 TeleportSceneClient = new TestClient(newAgent, neighbourScene, m_sceneManager);
623 neighbourScene.AddNewClient(TeleportSceneClient, PresenceType.User);
624 } 609 }
625 610
626 public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, 611 public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint,
@@ -635,12 +620,6 @@ namespace OpenSim.Tests.Common.Mock
635 // CompleteTeleportClientSide(); 620 // CompleteTeleportClientSide();
636 } 621 }
637 622
638 public void CompleteTeleportClientSide()
639 {
640 TeleportSceneClient.CompleteMovement();
641 //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false);
642 }
643
644 public virtual void SendTeleportFailed(string reason) 623 public virtual void SendTeleportFailed(string reason)
645 { 624 {
646 m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); 625 m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason);