diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ab1cfc3..927eeab 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
264 | // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, | 264 | // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, |
265 | // it's actually doing a lot of work. | 265 | // it's actually doing a lot of work. |
266 | IPEndPoint endPoint = finalDestination.ExternalEndPoint; | 266 | IPEndPoint endPoint = finalDestination.ExternalEndPoint; |
267 | if (endPoint.Address != null) | 267 | if (endPoint != null && endPoint.Address != null) |
268 | { | 268 | { |
269 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 269 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
270 | // both regions | 270 | // both regions |
@@ -851,15 +851,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
851 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 851 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
852 | 852 | ||
853 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); | 853 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); |
854 | if (eq != null) | 854 | IPEndPoint neighbourExternal = neighbourRegion.ExternalEndPoint; |
855 | { | 855 | if (neighbourExternal != null) |
856 | eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | ||
857 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | ||
858 | } | ||
859 | else | ||
860 | { | 856 | { |
861 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | 857 | if (eq != null) |
862 | capsPath); | 858 | { |
859 | eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal, | ||
860 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | ||
861 | } | ||
862 | else | ||
863 | { | ||
864 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal, | ||
865 | capsPath); | ||
866 | } | ||
863 | } | 867 | } |
864 | 868 | ||
865 | if (!WaitForCallback(agent.UUID)) | 869 | if (!WaitForCallback(agent.UUID)) |
@@ -957,10 +961,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
957 | agent.Viewer = currentAgentCircuit.Viewer; | 961 | agent.Viewer = currentAgentCircuit.Viewer; |
958 | } | 962 | } |
959 | 963 | ||
960 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; | 964 | IPEndPoint external = region.ExternalEndPoint; |
961 | d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true, | 965 | if (external != null) |
966 | { | ||
967 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; | ||
968 | d.BeginInvoke(sp, agent, region, external, true, | ||
962 | InformClientOfNeighbourCompleted, | 969 | InformClientOfNeighbourCompleted, |
963 | d); | 970 | d); |
971 | } | ||
964 | } | 972 | } |
965 | #endregion | 973 | #endregion |
966 | 974 | ||
@@ -1089,6 +1097,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1089 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; | 1097 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; |
1090 | try | 1098 | try |
1091 | { | 1099 | { |
1100 | //neighbour.ExternalEndPoint may return null, which will be caught | ||
1092 | d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent, | 1101 | d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent, |
1093 | InformClientOfNeighbourCompleted, | 1102 | InformClientOfNeighbourCompleted, |
1094 | d); | 1103 | d); |