aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs36
1 files changed, 21 insertions, 15 deletions
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