diff options
Diffstat (limited to 'OpenSim/Tests/Common/Mock/TestClient.cs')
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a448cc5..2d4fef1 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 |
@@ -595,23 +595,8 @@ namespace OpenSim.Tests.Common.Mock | |||
595 | 595 | ||
596 | public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) | 596 | public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) |
597 | { | 597 | { |
598 | m_log.DebugFormat("[TEST CLIENT]: Processing inform client of neighbour"); | 598 | if (OnTestClientInformClientOfNeighbour != null) |
599 | 599 | OnTestClientInformClientOfNeighbour(neighbourHandle, neighbourExternalEndPoint); | |
600 | // In response to this message, we are going to make a teleport to the scene we've previous been told | ||
601 | // about by test code (this needs to be improved). | ||
602 | AgentCircuitData newAgent = RequestClientInfo(); | ||
603 | |||
604 | // Stage 2: add the new client as a child agent to the scene | ||
605 | uint x, y; | ||
606 | Utils.LongToUInts(neighbourHandle, out x, out y); | ||
607 | x /= Constants.RegionSize; | ||
608 | y /= Constants.RegionSize; | ||
609 | |||
610 | Scene neighbourScene; | ||
611 | m_sceneManager.TryGetScene(x, y, out neighbourScene); | ||
612 | |||
613 | TeleportSceneClient = new TestClient(newAgent, neighbourScene, m_sceneManager); | ||
614 | neighbourScene.AddNewClient(TeleportSceneClient, PresenceType.User); | ||
615 | } | 600 | } |
616 | 601 | ||
617 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, | 602 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, |
@@ -626,12 +611,6 @@ namespace OpenSim.Tests.Common.Mock | |||
626 | // CompleteTeleportClientSide(); | 611 | // CompleteTeleportClientSide(); |
627 | } | 612 | } |
628 | 613 | ||
629 | public void CompleteTeleportClientSide() | ||
630 | { | ||
631 | TeleportSceneClient.CompleteMovement(); | ||
632 | //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); | ||
633 | } | ||
634 | |||
635 | public virtual void SendTeleportFailed(string reason) | 614 | public virtual void SendTeleportFailed(string reason) |
636 | { | 615 | { |
637 | m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); | 616 | m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); |