diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 49 |
1 files changed, 11 insertions, 38 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 38fff1c..54cc80f 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -327,43 +327,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
327 | 327 | ||
328 | // OK, it got this agent. Let's close some child agents | 328 | // OK, it got this agent. Let's close some child agents |
329 | sp.CloseChildAgents(newRegionX, newRegionY); | 329 | sp.CloseChildAgents(newRegionX, newRegionY); |
330 | 330 | IClientIPEndpoint ipepClient; | |
331 | if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 331 | if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
332 | { | 332 | { |
333 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); | 333 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); |
334 | |||
335 | #region IP Translation for NAT | 334 | #region IP Translation for NAT |
336 | IClientIPEndpoint ipepClient; | 335 | // Uses ipepClient above |
337 | if (sp.ClientView.TryGet(out ipepClient)) | 336 | if (sp.ClientView.TryGet(out ipepClient)) |
338 | { | 337 | { |
339 | capsPath | 338 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); |
340 | = "http://" | ||
341 | + NetworkUtil.GetHostFor(ipepClient.EndPoint, finalDestination.ExternalHostName) | ||
342 | + ":" | ||
343 | + finalDestination.HttpPort | ||
344 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
345 | } | ||
346 | else | ||
347 | { | ||
348 | capsPath | ||
349 | = "http://" | ||
350 | + finalDestination.ExternalHostName | ||
351 | + ":" | ||
352 | + finalDestination.HttpPort | ||
353 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
354 | } | 339 | } |
355 | #endregion | 340 | #endregion |
341 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
356 | 342 | ||
357 | if (eq != null) | 343 | if (eq != null) |
358 | { | 344 | { |
359 | #region IP Translation for NAT | ||
360 | // Uses ipepClient above | ||
361 | if (sp.ClientView.TryGet(out ipepClient)) | ||
362 | { | ||
363 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); | ||
364 | } | ||
365 | #endregion | ||
366 | |||
367 | eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); | 345 | eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); |
368 | 346 | ||
369 | // ES makes the client send a UseCircuitCode message to the destination, | 347 | // ES makes the client send a UseCircuitCode message to the destination, |
@@ -382,8 +360,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
382 | else | 360 | else |
383 | { | 361 | { |
384 | agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); | 362 | agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); |
385 | capsPath = "http://" + finalDestination.ExternalHostName + ":" + finalDestination.HttpPort | 363 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); |
386 | + "/CAPS/" + agentCircuit.CapsPath + "0000/"; | ||
387 | } | 364 | } |
388 | 365 | ||
389 | // Expect avatar crossing is a heavy-duty function at the destination. | 366 | // Expect avatar crossing is a heavy-duty function at the destination. |
@@ -516,8 +493,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
516 | 493 | ||
517 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) | 494 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) |
518 | { | 495 | { |
519 | agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort + | 496 | agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; |
520 | "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; | 497 | m_log.Debug("Set callback URL to " + agent.CallbackURI); |
521 | 498 | ||
522 | } | 499 | } |
523 | 500 | ||
@@ -842,8 +819,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
842 | cAgent.Position = pos; | 819 | cAgent.Position = pos; |
843 | if (isFlying) | 820 | if (isFlying) |
844 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 821 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
845 | cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + | 822 | cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + |
846 | "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; | 823 | "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; |
847 | 824 | ||
848 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) | 825 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
849 | { | 826 | { |
@@ -868,10 +845,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
868 | neighbourRegion.RegionHandle); | 845 | neighbourRegion.RegionHandle); |
869 | return agent; | 846 | return agent; |
870 | } | 847 | } |
871 | // TODO Should construct this behind a method | 848 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); |
872 | string capsPath = | ||
873 | "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort | ||
874 | + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; | ||
875 | 849 | ||
876 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 850 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
877 | 851 | ||
@@ -1190,8 +1164,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1190 | y = y / Constants.RegionSize; | 1164 | y = y / Constants.RegionSize; |
1191 | m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); | 1165 | m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); |
1192 | 1166 | ||
1193 | string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort | 1167 | string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); |
1194 | + "/CAPS/" + a.CapsPath + "0000/"; | ||
1195 | 1168 | ||
1196 | string reason = String.Empty; | 1169 | string reason = String.Empty; |
1197 | 1170 | ||