aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Mock
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-03-20 23:01:16 +0000
committerJustin Clark-Casey (justincc)2013-03-20 23:01:16 +0000
commit36651bed71ce1011c376078943a4fef7e8a9ada6 (patch)
tree61ca34a4595fa0d43990e29fa60e2f7962ca5189 /OpenSim/Tests/Common/Mock
parentInsert a short delay on the simulator side rezzing of attachments in order to... (diff)
downloadopensim-SC_OLD-36651bed71ce1011c376078943a4fef7e8a9ada6.zip
opensim-SC_OLD-36651bed71ce1011c376078943a4fef7e8a9ada6.tar.gz
opensim-SC_OLD-36651bed71ce1011c376078943a4fef7e8a9ada6.tar.bz2
opensim-SC_OLD-36651bed71ce1011c376078943a4fef7e8a9ada6.tar.xz
On the later forms of teleport failure, tell the user if this was because viewer couldn't/didn't connect with destination or if destination didn't signal teleport completion.
Also adds regression test for the case where the viewer couldn't connect with the destination region. Also refactoring of regression test support code associated with entity transfer in order to make this test possible and the code less obscure.
Diffstat (limited to 'OpenSim/Tests/Common/Mock')
-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 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);