From a490b34b6e584119312bd1b9ee8c30c4b9f02c62 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 22 Oct 2010 23:34:44 +0100 Subject: Revert "* more url / hg cleanup" This reverts commit 58f75fa19d9aea18283ecdbd44559efb81781c9d. --- .../EntityTransfer/EntityTransferModule.cs | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 54cc80f..3791e1d 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -327,21 +327,34 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // OK, it got this agent. Let's close some child agents sp.CloseChildAgents(newRegionX, newRegionY); - IClientIPEndpoint ipepClient; + if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) { //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); + #region IP Translation for NAT - // Uses ipepClient above + IClientIPEndpoint ipepClient; if (sp.ClientView.TryGet(out ipepClient)) { - endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); + capsPath + = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); + } + else + { + capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); } #endregion - capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); if (eq != null) { + #region IP Translation for NAT + // Uses ipepClient above + if (sp.ClientView.TryGet(out ipepClient)) + { + endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); + } + #endregion + eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); // ES makes the client send a UseCircuitCode message to the destination, @@ -360,7 +373,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer else { agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); - capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); + capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/"; } // Expect avatar crossing is a heavy-duty function at the destination. @@ -493,8 +506,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) { - agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; - m_log.Debug("Set callback URL to " + agent.CallbackURI); + agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; } @@ -820,7 +832,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (isFlying) cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + - "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; + "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) { @@ -845,7 +857,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer neighbourRegion.RegionHandle); return agent; } - string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); + // TODO Should construct this behind a method + string capsPath = + neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); @@ -1164,7 +1178,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer y = y / Constants.RegionSize; m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); - string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); + string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/"; string reason = String.Empty; -- cgit v1.1