diff options
author | UbitUmarov | 2017-05-25 09:46:29 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-25 09:46:29 +0100 |
commit | 31b4a3124692a2b73a42bb994a61012d747b830c (patch) | |
tree | 9753d4a67655fa776de4b55894622d957b97d83d /OpenSim/Region/CoreModules/Framework/EntityTransfer | |
parent | move assetsconnector threads to whatchdog; Abort all alive threads known to w... (diff) | |
download | opensim-SC-31b4a3124692a2b73a42bb994a61012d747b830c.zip opensim-SC-31b4a3124692a2b73a42bb994a61012d747b830c.tar.gz opensim-SC-31b4a3124692a2b73a42bb994a61012d747b830c.tar.bz2 opensim-SC-31b4a3124692a2b73a42bb994a61012d747b830c.tar.xz |
add some checks for valid endpoints
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 4b846f5..ca20604 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -527,15 +527,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
527 | { | 527 | { |
528 | string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); | 528 | string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); |
529 | 529 | ||
530 | string message; | 530 | string reason = String.Empty; |
531 | finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out message); | 531 | finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out reason); |
532 | 532 | ||
533 | if (finalDestination == null) | 533 | if (finalDestination == null) |
534 | { | 534 | { |
535 | m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}", | 535 | m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}", |
536 | LogHeader, sp.Name, sp.UUID, message); | 536 | LogHeader, sp.Name, sp.UUID, reason); |
537 | 537 | ||
538 | sp.ControllingClient.SendTeleportFailed(message); | 538 | sp.ControllingClient.SendTeleportFailed(reason); |
539 | return; | 539 | return; |
540 | } | 540 | } |
541 | 541 | ||
@@ -548,17 +548,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
548 | return; | 548 | return; |
549 | } | 549 | } |
550 | 550 | ||
551 | // Validate assorted conditions | ||
552 | string reason = string.Empty; | ||
553 | if (!ValidateGenericConditions(sp, reg, finalDestination, teleportFlags, out reason)) | 551 | if (!ValidateGenericConditions(sp, reg, finalDestination, teleportFlags, out reason)) |
554 | { | 552 | { |
555 | sp.ControllingClient.SendTeleportFailed(reason); | 553 | sp.ControllingClient.SendTeleportFailed(reason); |
556 | return; | 554 | return; |
557 | } | 555 | } |
558 | 556 | ||
559 | if (message != null) | ||
560 | sp.ControllingClient.SendAgentAlertMessage(message, true); | ||
561 | |||
562 | // | 557 | // |
563 | // This is it | 558 | // This is it |
564 | // | 559 | // |
@@ -735,8 +730,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
735 | IPEndPoint endPoint = finalDestination.ExternalEndPoint; | 730 | IPEndPoint endPoint = finalDestination.ExternalEndPoint; |
736 | if (endPoint == null || endPoint.Address == null) | 731 | if (endPoint == null || endPoint.Address == null) |
737 | { | 732 | { |
738 | sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down"); | 733 | sp.ControllingClient.SendTeleportFailed("Could not resolve destination Address"); |
739 | |||
740 | return; | 734 | return; |
741 | } | 735 | } |
742 | 736 | ||
@@ -784,22 +778,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
784 | // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to | 778 | // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to |
785 | // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). | 779 | // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). |
786 | sp.ControllingClient.SendTeleportStart(teleportFlags); | 780 | sp.ControllingClient.SendTeleportStart(teleportFlags); |
787 | 781 | ||
788 | // the avatar.Close below will clear the child region list. We need this below for (possibly) | ||
789 | // closing the child agents, so save it here (we need a copy as it is Clear()-ed). | ||
790 | //List<ulong> childRegions = avatar.KnownRegionHandles; | ||
791 | // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport | ||
792 | // failure at this point (unlike a border crossing failure). So perhaps this can never fail | ||
793 | // once we reach here... | ||
794 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); | ||
795 | |||
796 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 782 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
797 | AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); | 783 | AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); |
798 | agentCircuit.startpos = position; | 784 | agentCircuit.startpos = position; |
799 | agentCircuit.child = true; | 785 | agentCircuit.child = true; |
800 | 786 | ||
801 | // agentCircuit.Appearance = sp.Appearance; | ||
802 | // agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false); | ||
803 | agentCircuit.Appearance = new AvatarAppearance(); | 787 | agentCircuit.Appearance = new AvatarAppearance(); |
804 | agentCircuit.Appearance.AvatarHeight = sp.Appearance.AvatarHeight; | 788 | agentCircuit.Appearance.AvatarHeight = sp.Appearance.AvatarHeight; |
805 | 789 | ||
@@ -1673,6 +1657,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1673 | return agent; | 1657 | return agent; |
1674 | } | 1658 | } |
1675 | 1659 | ||
1660 | IPEndPoint endpoint = neighbourRegion.ExternalEndPoint; | ||
1661 | if(endpoint == null) | ||
1662 | { | ||
1663 | m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: failed to resolve neighbour address {0} ",neighbourRegion.ExternalHostName); | ||
1664 | return agent; | ||
1665 | } | ||
1666 | |||
1676 | m_entityTransferStateMachine.SetInTransit(agent.UUID); | 1667 | m_entityTransferStateMachine.SetInTransit(agent.UUID); |
1677 | agent.RemoveFromPhysicalScene(); | 1668 | agent.RemoveFromPhysicalScene(); |
1678 | 1669 | ||
@@ -1683,7 +1674,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1683 | return agent; | 1674 | return agent; |
1684 | } | 1675 | } |
1685 | 1676 | ||
1686 | CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx); | 1677 | CrossAgentToNewRegionPost(agent, pos, neighbourRegion, endpoint, isFlying, ctx); |
1687 | } | 1678 | } |
1688 | catch (Exception e) | 1679 | catch (Exception e) |
1689 | { | 1680 | { |
@@ -1727,6 +1718,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1727 | agent.AddNeighbourRegion(neighbourRegion, agentCircuit.CapsPath); | 1718 | agent.AddNeighbourRegion(neighbourRegion, agentCircuit.CapsPath); |
1728 | 1719 | ||
1729 | IPEndPoint endPoint = neighbourRegion.ExternalEndPoint; | 1720 | IPEndPoint endPoint = neighbourRegion.ExternalEndPoint; |
1721 | if(endPoint == null) | ||
1722 | { | ||
1723 | m_log.DebugFormat("CrossAgentCreateFarChild failed to resolve neighbour address {0}", neighbourRegion.ExternalHostName); | ||
1724 | return false; | ||
1725 | } | ||
1730 | if (Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason)) | 1726 | if (Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason)) |
1731 | { | 1727 | { |
1732 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | 1728 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); |
@@ -1821,7 +1817,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1821 | } | 1817 | } |
1822 | 1818 | ||
1823 | public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, | 1819 | public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, |
1824 | bool isFlying, EntityTransferContext ctx) | 1820 | IPEndPoint endpoint, bool isFlying, EntityTransferContext ctx) |
1825 | { | 1821 | { |
1826 | 1822 | ||
1827 | string agentcaps; | 1823 | string agentcaps; |
@@ -1848,15 +1844,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1848 | { | 1844 | { |
1849 | m_eqModule.CrossRegion( | 1845 | m_eqModule.CrossRegion( |
1850 | neighbourRegion.RegionHandle, pos, vel2 /* agent.Velocity */, | 1846 | neighbourRegion.RegionHandle, pos, vel2 /* agent.Velocity */, |
1851 | neighbourRegion.ExternalEndPoint, | 1847 | endpoint, capsPath, agent.UUID, agent.ControllingClient.SessionId, |
1852 | capsPath, agent.UUID, agent.ControllingClient.SessionId, | ||
1853 | neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); | 1848 | neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); |
1854 | } | 1849 | } |
1855 | else | 1850 | else |
1856 | { | 1851 | { |
1857 | m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader); | 1852 | m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader); |
1858 | agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | 1853 | agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos, agent.Velocity, |
1859 | capsPath); | 1854 | endpoint,capsPath); |
1860 | } | 1855 | } |
1861 | 1856 | ||
1862 | // SUCCESS! | 1857 | // SUCCESS! |
@@ -1953,7 +1948,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1953 | 1948 | ||
1954 | seeds.Add(regionhandler, agent.CapsPath); | 1949 | seeds.Add(regionhandler, agent.CapsPath); |
1955 | 1950 | ||
1956 | |||
1957 | // agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds); | 1951 | // agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds); |
1958 | agent.ChildrenCapSeeds = null; | 1952 | agent.ChildrenCapSeeds = null; |
1959 | 1953 | ||