diff options
author | Justin Clark-Casey (justincc) | 2012-05-01 23:14:12 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-01 23:14:12 +0100 |
commit | 9d2e1c67a8969e4769006c7347505b58a7827b3f (patch) | |
tree | 1fb6d412e2d8a753e1b59af46f6ada0a45556e75 /OpenSim/Region/CoreModules | |
parent | Move max teleport distance check down into etm.DoTeleport() since this should... (diff) | |
download | opensim-SC_OLD-9d2e1c67a8969e4769006c7347505b58a7827b3f.zip opensim-SC_OLD-9d2e1c67a8969e4769006c7347505b58a7827b3f.tar.gz opensim-SC_OLD-9d2e1c67a8969e4769006c7347505b58a7827b3f.tar.bz2 opensim-SC_OLD-9d2e1c67a8969e4769006c7347505b58a7827b3f.tar.xz |
Add regression test for teleporting between neighbouring regions on the same simulator
This adds a non-advertised wait_for_callback option in [EntityTransfer]. Default is always true.
Teleport tests disable the wait for callback from the destination region in order to run within a single thread.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 30 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | 7 |
2 files changed, 30 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 230706e..35486bb 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -52,12 +52,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
53 | 53 | ||
54 | public const int DefaultMaxTransferDistance = 4095; | 54 | public const int DefaultMaxTransferDistance = 4095; |
55 | public const bool EnableWaitForCallbackFromTeleportDestDefault = true; | ||
56 | |||
55 | 57 | ||
56 | /// <summary> | 58 | /// <summary> |
57 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. | 59 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. |
58 | /// </summary> | 60 | /// </summary> |
59 | public int MaxTransferDistance { get; set; } | 61 | public int MaxTransferDistance { get; set; } |
60 | 62 | ||
63 | /// <summary> | ||
64 | /// If true then on a teleport, the source region waits for a callback from the destination region. If | ||
65 | /// a callback fails to arrive within a set time then the user is pulled back into the source region. | ||
66 | /// </summary> | ||
67 | public bool EnableWaitForCallbackFromTeleportDest { get; set; } | ||
68 | |||
61 | protected bool m_Enabled = false; | 69 | protected bool m_Enabled = false; |
62 | protected Scene m_aScene; | 70 | protected Scene m_aScene; |
63 | protected List<Scene> m_Scenes = new List<Scene>(); | 71 | protected List<Scene> m_Scenes = new List<Scene>(); |
@@ -99,9 +107,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
99 | { | 107 | { |
100 | IConfig transferConfig = source.Configs["EntityTransfer"]; | 108 | IConfig transferConfig = source.Configs["EntityTransfer"]; |
101 | if (transferConfig != null) | 109 | if (transferConfig != null) |
110 | { | ||
111 | EnableWaitForCallbackFromTeleportDest | ||
112 | = transferConfig.GetBoolean("wait_for_callback", EnableWaitForCallbackFromTeleportDestDefault); | ||
113 | |||
102 | MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance); | 114 | MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance); |
115 | } | ||
103 | else | 116 | else |
117 | { | ||
104 | MaxTransferDistance = DefaultMaxTransferDistance; | 118 | MaxTransferDistance = DefaultMaxTransferDistance; |
119 | } | ||
105 | 120 | ||
106 | m_agentsInTransit = new List<UUID>(); | 121 | m_agentsInTransit = new List<UUID>(); |
107 | m_Enabled = true; | 122 | m_Enabled = true; |
@@ -499,6 +514,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
499 | } | 514 | } |
500 | else | 515 | else |
501 | { | 516 | { |
517 | ICapabilitiesModule capModule = sp.Scene.CapsModule; | ||
518 | ulong regionHandle = reg.RegionHandle; | ||
519 | capModule.GetChildSeed(UUID.Zero, regionHandle); | ||
502 | agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); | 520 | agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); |
503 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | 521 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); |
504 | } | 522 | } |
@@ -527,7 +545,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
527 | sp.ControllingClient.SendTeleportProgress(teleportFlags | (uint)TeleportFlags.DisableCancel, "sending_dest"); | 545 | sp.ControllingClient.SendTeleportProgress(teleportFlags | (uint)TeleportFlags.DisableCancel, "sending_dest"); |
528 | 546 | ||
529 | m_log.DebugFormat( | 547 | m_log.DebugFormat( |
530 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); | 548 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", |
549 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); | ||
531 | 550 | ||
532 | if (eq != null) | 551 | if (eq != null) |
533 | { | 552 | { |
@@ -546,7 +565,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
546 | // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which | 565 | // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which |
547 | // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation | 566 | // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation |
548 | // that the client contacted the destination before we close things here. | 567 | // that the client contacted the destination before we close things here. |
549 | if (!WaitForCallback(sp.UUID)) | 568 | if (EnableWaitForCallbackFromTeleportDest && !WaitForCallback(sp.UUID)) |
550 | { | 569 | { |
551 | m_log.WarnFormat( | 570 | m_log.WarnFormat( |
552 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.", | 571 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.", |
@@ -1286,7 +1305,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1286 | { | 1305 | { |
1287 | if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle) | 1306 | if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle) |
1288 | { | 1307 | { |
1289 | |||
1290 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 1308 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
1291 | AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); | 1309 | AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); |
1292 | agent.BaseFolder = UUID.Zero; | 1310 | agent.BaseFolder = UUID.Zero; |
@@ -1311,7 +1329,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1311 | seeds.Add(neighbour.RegionHandle, agent.CapsPath); | 1329 | seeds.Add(neighbour.RegionHandle, agent.CapsPath); |
1312 | } | 1330 | } |
1313 | else | 1331 | else |
1332 | { | ||
1314 | agent.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, neighbour.RegionHandle); | 1333 | agent.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, neighbour.RegionHandle); |
1334 | } | ||
1315 | 1335 | ||
1316 | cagents.Add(agent); | 1336 | cagents.Add(agent); |
1317 | } | 1337 | } |
@@ -1926,7 +1946,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1926 | int count = 200; | 1946 | int count = 200; |
1927 | while (m_agentsInTransit.Contains(id) && count-- > 0) | 1947 | while (m_agentsInTransit.Contains(id) && count-- > 0) |
1928 | { | 1948 | { |
1929 | //m_log.Debug(" >>> Waiting... " + count); | 1949 | // m_log.Debug(" >>> Waiting... " + count); |
1930 | Thread.Sleep(100); | 1950 | Thread.Sleep(100); |
1931 | } | 1951 | } |
1932 | 1952 | ||
@@ -1934,6 +1954,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1934 | return true; | 1954 | return true; |
1935 | else | 1955 | else |
1936 | return false; | 1956 | return false; |
1957 | |||
1958 | return true; | ||
1937 | } | 1959 | } |
1938 | 1960 | ||
1939 | protected void SetInTransit(UUID id) | 1961 | protected void SetInTransit(UUID id) |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs index d6afaa9..21d8bd7 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | |||
@@ -64,8 +64,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
64 | IConfigSource config = new IniConfigSource(); | 64 | IConfigSource config = new IniConfigSource(); |
65 | config.AddConfig("Modules"); | 65 | config.AddConfig("Modules"); |
66 | config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); | 66 | config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); |
67 | 67 | ||
68 | m_scene = new SceneHelpers().SetupScene(); | 68 | SceneHelpers sceneHelpers = new SceneHelpers(); |
69 | m_scene = sceneHelpers.SetupScene(); | ||
69 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); | 70 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); |
70 | 71 | ||
71 | // Create user | 72 | // Create user |
@@ -76,7 +77,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
76 | 77 | ||
77 | AgentCircuitData acd = new AgentCircuitData(); | 78 | AgentCircuitData acd = new AgentCircuitData(); |
78 | acd.AgentID = m_userId; | 79 | acd.AgentID = m_userId; |
79 | m_tc = new TestClient(acd, m_scene); | 80 | m_tc = new TestClient(acd, m_scene); |
80 | } | 81 | } |
81 | 82 | ||
82 | [Test] | 83 | [Test] |