diff options
author | Justin Clark-Casey (justincc) | 2013-03-20 23:01:16 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-03-20 23:01:16 +0000 |
commit | 36651bed71ce1011c376078943a4fef7e8a9ada6 (patch) | |
tree | 61ca34a4595fa0d43990e29fa60e2f7962ca5189 /OpenSim/Region/CoreModules | |
parent | Insert a short delay on the simulator side rezzing of attachments in order to... (diff) | |
download | opensim-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/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 36 |
2 files changed, 29 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 4cd03da..c8c594d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -829,7 +829,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
829 | sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule()); | 829 | sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule()); |
830 | 830 | ||
831 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1); | 831 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1); |
832 | ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, ua1.PrincipalID, sh.SceneManager); | 832 | |
833 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID); | ||
834 | TestClient tc = new TestClient(acd, sceneA, sh.SceneManager); | ||
835 | List<TestClient> destinationTestClients = new List<TestClient>(); | ||
836 | EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients); | ||
837 | |||
838 | ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd, sh.SceneManager); | ||
833 | beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32); | 839 | beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32); |
834 | 840 | ||
835 | InventoryItemBase attItem = CreateAttachmentItem(sceneA, ua1.PrincipalID, "att", 0x10, 0x20); | 841 | InventoryItemBase attItem = CreateAttachmentItem(sceneA, ua1.PrincipalID, "att", 0x10, 0x20); |
@@ -848,7 +854,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
848 | teleportLookAt, | 854 | teleportLookAt, |
849 | (uint)TeleportFlags.ViaLocation); | 855 | (uint)TeleportFlags.ViaLocation); |
850 | 856 | ||
851 | ((TestClient)beforeTeleportSp.ControllingClient).CompleteTeleportClientSide(); | 857 | destinationTestClients[0].CompleteMovement(); |
852 | 858 | ||
853 | // Check attachments have made it into sceneB | 859 | // Check attachments have made it into sceneB |
854 | ScenePresence afterTeleportSceneBSp = sceneB.GetScenePresence(ua1.PrincipalID); | 860 | ScenePresence afterTeleportSceneBSp = sceneB.GetScenePresence(ua1.PrincipalID); |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 9b1b69a..58a6654 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -517,12 +517,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
517 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for teleport of {0} from {1} to {2}. Continuing.", | 517 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for teleport of {0} from {1} to {2}. Continuing.", |
518 | sp.Name, sp.Scene.RegionInfo.RegionName, finalDestination.RegionName); | 518 | sp.Name, sp.Scene.RegionInfo.RegionName, finalDestination.RegionName); |
519 | 519 | ||
520 | // if (!sp.ValidateAttachments()) | ||
521 | // { | ||
522 | // sp.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); | ||
523 | // return; | ||
524 | // } | ||
525 | |||
526 | string reason; | 520 | string reason; |
527 | string version; | 521 | string version; |
528 | if (!Scene.SimulationService.QueryAccess( | 522 | if (!Scene.SimulationService.QueryAccess( |
@@ -583,6 +577,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
583 | } | 577 | } |
584 | 578 | ||
585 | // Let's create an agent there if one doesn't exist yet. | 579 | // Let's create an agent there if one doesn't exist yet. |
580 | // NOTE: logout will always be false for a non-HG teleport. | ||
586 | bool logout = false; | 581 | bool logout = false; |
587 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) | 582 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) |
588 | { | 583 | { |
@@ -625,11 +620,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
625 | 620 | ||
626 | if (m_eqModule != null) | 621 | if (m_eqModule != null) |
627 | { | 622 | { |
623 | // The EnableSimulator message makes the client establish a connection with the destination | ||
624 | // simulator by sending the initial UseCircuitCode UDP packet to the destination containing the | ||
625 | // correct circuit code. | ||
628 | m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID); | 626 | m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID); |
629 | 627 | ||
630 | // ES makes the client send a UseCircuitCode message to the destination, | 628 | // XXX: Is this wait necessary? We will always end up waiting on UpdateAgent for the destination |
631 | // which triggers a bunch of things there. | 629 | // simulator to confirm that it has established communication with the viewer. |
632 | // So let's wait | ||
633 | Thread.Sleep(200); | 630 | Thread.Sleep(200); |
634 | 631 | ||
635 | // At least on LL 3.3.4 for teleports between different regions on the same simulator this appears | 632 | // At least on LL 3.3.4 for teleports between different regions on the same simulator this appears |
@@ -640,6 +637,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
640 | } | 637 | } |
641 | else | 638 | else |
642 | { | 639 | { |
640 | // XXX: This is a little misleading since we're information the client of its avatar destination, | ||
641 | // which may or may not be a neighbour region of the source region. This path is probably little | ||
642 | // used anyway (with EQ being the one used). But it is currently being used for test code. | ||
643 | sp.ControllingClient.InformClientOfNeighbour(destinationHandle, endPoint); | 643 | sp.ControllingClient.InformClientOfNeighbour(destinationHandle, endPoint); |
644 | } | 644 | } |
645 | } | 645 | } |
@@ -657,14 +657,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
657 | 657 | ||
658 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); | 658 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); |
659 | 659 | ||
660 | // A common teleport failure occurs when we can send CreateAgent to the | ||
661 | // destination region but the viewer cannot establish the connection (e.g. due to network issues between | ||
662 | // the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then | ||
663 | // there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail(). | ||
660 | if (!UpdateAgent(reg, finalDestination, agent, sp)) | 664 | if (!UpdateAgent(reg, finalDestination, agent, sp)) |
661 | { | 665 | { |
662 | // Region doesn't take it | ||
663 | m_log.WarnFormat( | 666 | m_log.WarnFormat( |
664 | "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Returning avatar to source region.", | 667 | "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Keeping avatar in source region.", |
665 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); | 668 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); |
666 | 669 | ||
667 | Fail(sp, finalDestination, logout); | 670 | Fail(sp, finalDestination, logout, "Connection between viewer and destination region could not be established."); |
668 | return; | 671 | return; |
669 | } | 672 | } |
670 | 673 | ||
@@ -705,7 +708,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
705 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.", | 708 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.", |
706 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); | 709 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); |
707 | 710 | ||
708 | Fail(sp, finalDestination, logout); | 711 | Fail(sp, finalDestination, logout, "Destination region did not signal teleport completion."); |
709 | return; | 712 | return; |
710 | } | 713 | } |
711 | 714 | ||
@@ -788,12 +791,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
788 | /// <param name='sp'></param> | 791 | /// <param name='sp'></param> |
789 | /// <param name='finalDestination'></param> | 792 | /// <param name='finalDestination'></param> |
790 | /// <param name='logout'></param> | 793 | /// <param name='logout'></param> |
791 | protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout) | 794 | /// <param name='reason'>Human readable reason for teleport failure. Will be sent to client.</param> |
795 | protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout, string reason) | ||
792 | { | 796 | { |
793 | CleanupAbortedInterRegionTeleport(sp, finalDestination); | 797 | CleanupAbortedInterRegionTeleport(sp, finalDestination); |
794 | 798 | ||
795 | sp.ControllingClient.SendTeleportFailed( | 799 | sp.ControllingClient.SendTeleportFailed( |
796 | string.Format("Problems connecting to destination {0}", finalDestination.RegionName)); | 800 | string.Format( |
801 | "Problems connecting to destination {0}, reason: {1}", finalDestination.RegionName, reason)); | ||
802 | |||
797 | sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); | 803 | sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); |
798 | } | 804 | } |
799 | 805 | ||