aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Capabilities/CapsUtil.cs2
-rw-r--r--OpenSim/Framework/RegionInfo.cs39
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs4
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs57
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs4
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs10
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs50
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/Land/LandServiceConnector.cs3
-rw-r--r--OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs4
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs55
-rw-r--r--OpenSim/Services/GridService/GridService.cs2
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs80
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs2
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs17
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs17
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs29
25 files changed, 193 insertions, 214 deletions
diff --git a/OpenSim/Framework/Capabilities/CapsUtil.cs b/OpenSim/Framework/Capabilities/CapsUtil.cs
index faf2708..0334e4b 100644
--- a/OpenSim/Framework/Capabilities/CapsUtil.cs
+++ b/OpenSim/Framework/Capabilities/CapsUtil.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Capabilities
41 /// <returns></returns> 41 /// <returns></returns>
42 public static string GetCapsSeedPath(string capsObjectPath) 42 public static string GetCapsSeedPath(string capsObjectPath)
43 { 43 {
44 return "CAPS/" + capsObjectPath + "0000/"; 44 return "/CAPS/" + capsObjectPath + "0000/";
45 } 45 }
46 46
47 /// <summary> 47 /// <summary>
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 73b8bd0..08d5398 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -115,20 +115,8 @@ namespace OpenSim.Framework
115 /// </summary> 115 /// </summary>
116 public string ServerURI 116 public string ServerURI
117 { 117 {
118 get { 118 get { return m_serverURI; }
119 if ( m_serverURI != string.Empty ) { 119 set { m_serverURI = value; }
120 return m_serverURI;
121 } else {
122 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
123 }
124 }
125 set {
126 if ( value.EndsWith("/") ) {
127 m_serverURI = value;
128 } else {
129 m_serverURI = value + '/';
130 }
131 }
132 } 120 }
133 protected string m_serverURI; 121 protected string m_serverURI;
134 122
@@ -153,7 +141,6 @@ namespace OpenSim.Framework
153 141
154 public SimpleRegionInfo() 142 public SimpleRegionInfo()
155 { 143 {
156 m_serverURI = string.Empty;
157 } 144 }
158 145
159 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) 146 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
@@ -163,7 +150,6 @@ namespace OpenSim.Framework
163 150
164 m_internalEndPoint = internalEndPoint; 151 m_internalEndPoint = internalEndPoint;
165 m_externalHostName = externalUri; 152 m_externalHostName = externalUri;
166 m_serverURI = string.Empty;
167 } 153 }
168 154
169 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port) 155 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
@@ -174,7 +160,6 @@ namespace OpenSim.Framework
174 m_externalHostName = externalUri; 160 m_externalHostName = externalUri;
175 161
176 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port); 162 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
177 m_serverURI = string.Empty;
178 } 163 }
179 164
180 public SimpleRegionInfo(RegionInfo ConvertFrom) 165 public SimpleRegionInfo(RegionInfo ConvertFrom)
@@ -464,7 +449,6 @@ namespace OpenSim.Framework
464 configMember = 449 configMember =
465 new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); 450 new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
466 configMember.performConfigurationRetrieve(); 451 configMember.performConfigurationRetrieve();
467 m_serverURI = string.Empty;
468 } 452 }
469 453
470 public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) 454 public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
@@ -474,12 +458,10 @@ namespace OpenSim.Framework
474 458
475 m_internalEndPoint = internalEndPoint; 459 m_internalEndPoint = internalEndPoint;
476 m_externalHostName = externalUri; 460 m_externalHostName = externalUri;
477 m_serverURI = string.Empty;
478 } 461 }
479 462
480 public RegionInfo() 463 public RegionInfo()
481 { 464 {
482 m_serverURI = string.Empty;
483 } 465 }
484 466
485 public EstateSettings EstateSettings 467 public EstateSettings EstateSettings
@@ -569,23 +551,10 @@ namespace OpenSim.Framework
569 /// <summary> 551 /// <summary>
570 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName) 552 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
571 /// </summary> 553 /// </summary>
572
573 public string ServerURI 554 public string ServerURI
574 { 555 {
575 get { 556 get { return m_serverURI; }
576 if ( m_serverURI != string.Empty ) { 557 set { m_serverURI = value; }
577 return m_serverURI;
578 } else {
579 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
580 }
581 }
582 set {
583 if ( value.EndsWith("/") ) {
584 m_serverURI = value;
585 } else {
586 m_serverURI = value + '/';
587 }
588 }
589 } 558 }
590 559
591 public string RegionName 560 public string RegionName
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 0c1e5e0..ba8c194 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -348,7 +348,7 @@ namespace OpenSim.Framework.Servers.HttpServer
348 { 348 {
349 try 349 try
350 { 350 {
351 //m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); 351// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
352 352
353 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); 353 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
354 354
@@ -376,7 +376,7 @@ namespace OpenSim.Framework.Servers.HttpServer
376 string path = request.RawUrl; 376 string path = request.RawUrl;
377 string handlerKey = GetHandlerKey(request.HttpMethod, path); 377 string handlerKey = GetHandlerKey(request.HttpMethod, path);
378 378
379 //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); 379// m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
380 380
381 if (TryGetStreamHandler(handlerKey, out requestHandler)) 381 if (TryGetStreamHandler(handlerKey, out requestHandler))
382 { 382 {
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 904a50c..74ad168 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -327,8 +327,8 @@ namespace OpenSim
327 //regionInfo.originRegionID = regionInfo.RegionID; 327 //regionInfo.originRegionID = regionInfo.RegionID;
328 328
329 // set initial ServerURI 329 // set initial ServerURI
330 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.InternalEndPoint.Port;
330 regionInfo.HttpPort = m_httpServerPort; 331 regionInfo.HttpPort = m_httpServerPort;
331 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/";
332 332
333 regionInfo.osSecret = m_osSecret; 333 regionInfo.osSecret = m_osSecret;
334 334
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 624814a..cb298fd 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -631,7 +631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
631 IClientAPI client; 631 IClientAPI client;
632 if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView)) 632 if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView))
633 { 633 {
634 m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); 634 //m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
635 return; 635 return;
636 } 636 }
637 637
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index fdc48c6..918fa04 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -599,7 +599,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
599 try 599 try
600 { 600 {
601 601
602 XmlRpcResponse GridResp = GridReq.Send(reginfo.ServerURI, 3000); 602 XmlRpcResponse GridResp = GridReq.Send("http://" + reginfo.ExternalHostName + ":" + reginfo.HttpPort, 3000);
603 603
604 Hashtable responseData = (Hashtable)GridResp.Value; 604 Hashtable responseData = (Hashtable)GridResp.Value;
605 605
@@ -621,8 +621,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
621 } 621 }
622 catch (WebException e) 622 catch (WebException e)
623 { 623 {
624 m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0}} the host didn't respond ({2})", 624 m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to http://{0}:{1} the host didn't respond ({2})",
625 reginfo.ServerURI, e.Message); 625 reginfo.ExternalHostName, reginfo.HttpPort, e.Message);
626 } 626 }
627 627
628 return false; 628 return false;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 925af3f..38fff1c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -197,8 +197,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
197 sp.ControllingClient.SendTeleportFailed("Problem at destination"); 197 sp.ControllingClient.SendTeleportFailed("Problem at destination");
198 return; 198 return;
199 } 199 }
200 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} {2}@{3}", 200 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} uuid={2}",
201 finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID, finalDestination.ServerURI); 201 finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID);
202 202
203 // Check that these are not the same coordinates 203 // Check that these are not the same coordinates
204 if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX && 204 if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX &&
@@ -254,8 +254,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
254 } 254 }
255 255
256 m_log.DebugFormat( 256 m_log.DebugFormat(
257 "[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}", 257 "[ENTITY TRANSFER MODULE]: Request Teleport to {0}:{1}:{2}/{3}",
258 reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position); 258 reg.ExternalHostName, reg.HttpPort, finalDestination.RegionName, position);
259 259
260 uint newRegionX = (uint)(reg.RegionHandle >> 40); 260 uint newRegionX = (uint)(reg.RegionHandle >> 40);
261 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); 261 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
@@ -327,21 +327,43 @@ 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 IClientIPEndpoint ipepClient; 330
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
334 #region IP Translation for NAT 335 #region IP Translation for NAT
335 // Uses ipepClient above 336 IClientIPEndpoint ipepClient;
336 if (sp.ClientView.TryGet(out ipepClient)) 337 if (sp.ClientView.TryGet(out ipepClient))
337 { 338 {
338 endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); 339 capsPath
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);
339 } 354 }
340 #endregion 355 #endregion
341 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
342 356
343 if (eq != null) 357 if (eq != null)
344 { 358 {
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
345 eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); 367 eq.EnableSimulator(destinationHandle, endPoint, sp.UUID);
346 368
347 // ES makes the client send a UseCircuitCode message to the destination, 369 // ES makes the client send a UseCircuitCode message to the destination,
@@ -360,7 +382,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
360 else 382 else
361 { 383 {
362 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); 384 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
363 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 385 capsPath = "http://" + finalDestination.ExternalHostName + ":" + finalDestination.HttpPort
386 + "/CAPS/" + agentCircuit.CapsPath + "0000/";
364 } 387 }
365 388
366 // Expect avatar crossing is a heavy-duty function at the destination. 389 // Expect avatar crossing is a heavy-duty function at the destination.
@@ -493,8 +516,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
493 516
494 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) 517 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
495 { 518 {
496 agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; 519 agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort +
497 m_log.Debug("Set callback URL to " + agent.CallbackURI); 520 "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
498 521
499 } 522 }
500 523
@@ -819,8 +842,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
819 cAgent.Position = pos; 842 cAgent.Position = pos;
820 if (isFlying) 843 if (isFlying)
821 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 844 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
822 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + 845 cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort +
823 "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; 846 "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
824 847
825 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) 848 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
826 { 849 {
@@ -845,7 +868,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
845 neighbourRegion.RegionHandle); 868 neighbourRegion.RegionHandle);
846 return agent; 869 return agent;
847 } 870 }
848 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); 871 // TODO Should construct this behind a method
872 string capsPath =
873 "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort
874 + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
849 875
850 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); 876 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
851 877
@@ -1164,7 +1190,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1164 y = y / Constants.RegionSize; 1190 y = y / Constants.RegionSize;
1165 m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); 1191 m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
1166 1192
1167 string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); 1193 string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort
1194 + "/CAPS/" + a.CapsPath + "0000/";
1168 1195
1169 string reason = String.Empty; 1196 string reason = String.Empty;
1170 1197
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 9a275ae..1ac7508 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -123,9 +123,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
123 if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) 123 if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
124 { 124 {
125 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); 125 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
126 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); 126 return m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
127 m_log.Debug("GetfinalDestination serveruri -> " + real_destination.ServerURI);
128 return real_destination;
129 } 127 }
130 return region; 128 return region;
131 } 129 }
@@ -151,7 +149,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
151 149
152 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) 150 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
153 { 151 {
154 m_log.Debug("CreateAgent " + reg.ServerURI + " " + finalDestination.ServerURI);
155 reason = string.Empty; 152 reason = string.Empty;
156 logout = false; 153 logout = false;
157 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); 154 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index 2dd7767..fd0e879 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -595,12 +595,12 @@ namespace OpenSim.Region.CoreModules.InterGrid
595 // DEPRECATED 595 // DEPRECATED
596 responseMap["seed_capability"] 596 responseMap["seed_capability"]
597 = OSD.FromString( 597 = OSD.FromString(
598 regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); 598 regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
599 599
600 // REPLACEMENT 600 // REPLACEMENT
601 responseMap["region_seed_capability"] 601 responseMap["region_seed_capability"]
602 = OSD.FromString( 602 = OSD.FromString(
603 regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); 603 regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
604 604
605 responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); 605 responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath);
606 responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); 606 responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath);
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index fdbbccf..a182eea 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
147 147
148 string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); 148 string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString();
149 regionimage = regionimage.Replace("-", ""); 149 regionimage = regionimage.Replace("-", "");
150 m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "/index.php?method=" + regionimage); 150 m_log.Info("[WORLD MAP]: JPEG Map location: http://" + m_scene.RegionInfo.ExternalEndPoint.Address.ToString() + ":" + m_scene.RegionInfo.HttpPort.ToString() + "/index.php?method=" + regionimage);
151 151
152 MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); 152 MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage);
153 MainServer.Instance.AddLLSDHandler( 153 MainServer.Instance.AddLLSDHandler(
@@ -579,7 +579,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
579 579
580 if (mreg != null) 580 if (mreg != null)
581 { 581 {
582 httpserver = mreg.ServerURI + "MAP/MapItems/" + regionhandle.ToString(); 582 httpserver = "http://" + mreg.ExternalEndPoint.Address.ToString() + ":" + mreg.HttpPort + "/MAP/MapItems/" + regionhandle.ToString();
583 lock (m_cachedRegionMapItemsAddress) 583 lock (m_cachedRegionMapItemsAddress)
584 { 584 {
585 if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle)) 585 if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle))
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4878b3e..3dd0f3a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3738,12 +3738,9 @@ namespace OpenSim.Region.Framework.Scenes
3738 3738
3739 // We have to wait until the viewer contacts this region after receiving EAC. 3739 // We have to wait until the viewer contacts this region after receiving EAC.
3740 // That calls AddNewClient, which finally creates the ScenePresence 3740 // That calls AddNewClient, which finally creates the ScenePresence
3741 m_log.Debug("ICADU -> pre wait");
3742 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); 3741 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
3743 m_log.Debug("ICADU -> post wait");
3744 if (childAgentUpdate != null) 3742 if (childAgentUpdate != null)
3745 { 3743 {
3746 m_log.Debug("ICADU -> not child agent!");
3747 childAgentUpdate.ChildAgentDataUpdate(cAgentData); 3744 childAgentUpdate.ChildAgentDataUpdate(cAgentData);
3748 return true; 3745 return true;
3749 } 3746 }
@@ -3759,7 +3756,7 @@ namespace OpenSim.Region.Framework.Scenes
3759 /// <returns>true if we handled it.</returns> 3756 /// <returns>true if we handled it.</returns>
3760 public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) 3757 public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData)
3761 { 3758 {
3762 m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); 3759 //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName);
3763 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); 3760 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
3764 if (childAgentUpdate != null) 3761 if (childAgentUpdate != null)
3765 { 3762 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 68ac178..13d9964 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2925,7 +2925,7 @@ namespace OpenSim.Region.Framework.Scenes
2925 2925
2926 public void ChildAgentDataUpdate(AgentData cAgentData) 2926 public void ChildAgentDataUpdate(AgentData cAgentData)
2927 { 2927 {
2928 m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); 2928 //m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName);
2929 if (!IsChildAgent) 2929 if (!IsChildAgent)
2930 return; 2930 return;
2931 2931
@@ -2976,8 +2976,6 @@ namespace OpenSim.Region.Framework.Scenes
2976 2976
2977 public void CopyTo(AgentData cAgent) 2977 public void CopyTo(AgentData cAgent)
2978 { 2978 {
2979 cAgent.CallbackURI = m_callbackURI;
2980
2981 cAgent.AgentID = UUID; 2979 cAgent.AgentID = UUID;
2982 cAgent.RegionID = Scene.RegionInfo.RegionID; 2980 cAgent.RegionID = Scene.RegionInfo.RegionID;
2983 2981
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index a5ec4f2..f64a079 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -124,8 +124,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
124 UUID uuid = UUID.Zero; 124 UUID uuid = UUID.Zero;
125 string regionname = string.Empty; 125 string regionname = string.Empty;
126 string gatekeeper_host = string.Empty; 126 string gatekeeper_host = string.Empty;
127 string gatekeeper_serveruri = string.Empty;
128 string destination_serveruri = string.Empty;
129 int gatekeeper_port = 0; 127 int gatekeeper_port = 0;
130 IPEndPoint client_ipaddress = null; 128 IPEndPoint client_ipaddress = null;
131 129
@@ -133,13 +131,8 @@ namespace OpenSim.Server.Handlers.Hypergrid
133 gatekeeper_host = args["gatekeeper_host"].AsString(); 131 gatekeeper_host = args["gatekeeper_host"].AsString();
134 if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null) 132 if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null)
135 Int32.TryParse(args["gatekeeper_port"].AsString(), out gatekeeper_port); 133 Int32.TryParse(args["gatekeeper_port"].AsString(), out gatekeeper_port);
136 if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] !=null)
137 gatekeeper_serveruri = args["gatekeeper_serveruri"];
138 if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] !=null)
139 destination_serveruri = args["destination_serveruri"];
140 134
141 GridRegion gatekeeper = new GridRegion(); 135 GridRegion gatekeeper = new GridRegion();
142 gatekeeper.ServerURI = gatekeeper_serveruri;
143 gatekeeper.ExternalHostName = gatekeeper_host; 136 gatekeeper.ExternalHostName = gatekeeper_host;
144 gatekeeper.HttpPort = (uint)gatekeeper_port; 137 gatekeeper.HttpPort = (uint)gatekeeper_port;
145 gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); 138 gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
@@ -180,8 +173,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
180 destination.RegionLocX = x; 173 destination.RegionLocX = x;
181 destination.RegionLocY = y; 174 destination.RegionLocY = y;
182 destination.RegionName = regionname; 175 destination.RegionName = regionname;
183 destination.ServerURI = destination_serveruri; 176
184
185 AgentCircuitData aCircuit = new AgentCircuitData(); 177 AgentCircuitData aCircuit = new AgentCircuitData();
186 try 178 try
187 { 179 {
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 70bafda..479a80e 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -63,12 +63,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
63 63
64 protected override string AgentPath() 64 protected override string AgentPath()
65 { 65 {
66 return "foreignagent/"; 66 return "/foreignagent/";
67 } 67 }
68 68
69 protected override string ObjectPath() 69 protected override string ObjectPath()
70 { 70 {
71 return "foreignobject/"; 71 return "/foreignobject/";
72 } 72 }
73 73
74 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason) 74 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason)
@@ -86,11 +86,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
86 paramList.Add(hash); 86 paramList.Add(hash);
87 87
88 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); 88 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
89 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + info.ServerURI); 89 string uri = "http://" + ((info.ServerURI != null && info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/");
90 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
90 XmlRpcResponse response = null; 91 XmlRpcResponse response = null;
91 try 92 try
92 { 93 {
93 response = request.Send(info.ServerURI, 10000); 94 response = request.Send(uri, 10000);
94 } 95 }
95 catch (Exception e) 96 catch (Exception e)
96 { 97 {
@@ -107,8 +108,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
107 } 108 }
108 109
109 hash = (Hashtable)response.Value; 110 hash = (Hashtable)response.Value;
110 foreach (Object o in hash) 111 //foreach (Object o in hash)
111 m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); 112 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
112 try 113 try
113 { 114 {
114 bool success = false; 115 bool success = false;
@@ -116,20 +117,16 @@ namespace OpenSim.Services.Connectors.Hypergrid
116 if (success) 117 if (success)
117 { 118 {
118 UUID.TryParse((string)hash["uuid"], out regionID); 119 UUID.TryParse((string)hash["uuid"], out regionID);
119 m_log.Debug(">> HERE, uuid: " + regionID); 120 //m_log.Debug(">> HERE, uuid: " + uuid);
120 if ((string)hash["handle"] != null) 121 if ((string)hash["handle"] != null)
121 { 122 {
122 realHandle = Convert.ToUInt64((string)hash["handle"]); 123 realHandle = Convert.ToUInt64((string)hash["handle"]);
123 m_log.Debug(">> HERE, realHandle: " + realHandle); 124 //m_log.Debug(">> HERE, realHandle: " + realHandle);
124 } 125 }
125 if (hash["region_image"] != null) { 126 if (hash["region_image"] != null)
126 imageURL = (string)hash["region_image"]; 127 imageURL = (string)hash["region_image"];
127 m_log.Debug(">> HERE, imageURL: " + imageURL); 128 if (hash["external_name"] != null)
128 }
129 if (hash["external_name"] != null) {
130 externalName = (string)hash["external_name"]; 129 externalName = (string)hash["external_name"];
131 m_log.Debug(">> HERE, externalName: " + externalName);
132 }
133 } 130 }
134 131
135 } 132 }
@@ -191,11 +188,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
191 paramList.Add(hash); 188 paramList.Add(hash);
192 189
193 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); 190 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
194 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + gatekeeper.ServerURI); 191 string uri = "http://" + ((gatekeeper.ServerURI != null && gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/");
192 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
195 XmlRpcResponse response = null; 193 XmlRpcResponse response = null;
196 try 194 try
197 { 195 {
198 response = request.Send(gatekeeper.ServerURI, 10000); 196 response = request.Send(uri, 10000);
199 } 197 }
200 catch (Exception e) 198 catch (Exception e)
201 { 199 {
@@ -221,48 +219,38 @@ namespace OpenSim.Services.Connectors.Hypergrid
221 GridRegion region = new GridRegion(); 219 GridRegion region = new GridRegion();
222 220
223 UUID.TryParse((string)hash["uuid"], out region.RegionID); 221 UUID.TryParse((string)hash["uuid"], out region.RegionID);
224 m_log.Debug(">> HERE, uuid: " + region.RegionID); 222 //m_log.Debug(">> HERE, uuid: " + region.RegionID);
225 int n = 0; 223 int n = 0;
226 if (hash["x"] != null) 224 if (hash["x"] != null)
227 { 225 {
228 Int32.TryParse((string)hash["x"], out n); 226 Int32.TryParse((string)hash["x"], out n);
229 region.RegionLocX = n; 227 region.RegionLocX = n;
230 m_log.Debug(">> HERE, x: " + region.RegionLocX); 228 //m_log.Debug(">> HERE, x: " + region.RegionLocX);
231 } 229 }
232 if (hash["y"] != null) 230 if (hash["y"] != null)
233 { 231 {
234 Int32.TryParse((string)hash["y"], out n); 232 Int32.TryParse((string)hash["y"], out n);
235 region.RegionLocY = n; 233 region.RegionLocY = n;
236 m_log.Debug(">> HERE, y: " + region.RegionLocY); 234 //m_log.Debug(">> HERE, y: " + region.RegionLocY);
237 } 235 }
238 if (hash["region_name"] != null) 236 if (hash["region_name"] != null)
239 { 237 {
240 region.RegionName = (string)hash["region_name"]; 238 region.RegionName = (string)hash["region_name"];
241 m_log.Debug(">> HERE, region_name: " + region.RegionName); 239 //m_log.Debug(">> HERE, name: " + region.RegionName);
242 } 240 }
243 if (hash["hostname"] != null) { 241 if (hash["hostname"] != null)
244 region.ExternalHostName = (string)hash["hostname"]; 242 region.ExternalHostName = (string)hash["hostname"];
245 m_log.Debug(">> HERE, hostname: " + region.ExternalHostName);
246 }
247 if (hash["http_port"] != null) 243 if (hash["http_port"] != null)
248 { 244 {
249 uint p = 0; 245 uint p = 0;
250 UInt32.TryParse((string)hash["http_port"], out p); 246 UInt32.TryParse((string)hash["http_port"], out p);
251 region.HttpPort = p; 247 region.HttpPort = p;
252 m_log.Debug(">> HERE, http_port: " + region.HttpPort);
253 } 248 }
254 if (hash["internal_port"] != null) 249 if (hash["internal_port"] != null)
255 { 250 {
256 int p = 0; 251 int p = 0;
257 Int32.TryParse((string)hash["internal_port"], out p); 252 Int32.TryParse((string)hash["internal_port"], out p);
258 region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); 253 region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p);
259 m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint);
260 }
261
262 if (hash["server_uri"] != null)
263 {
264 region.ServerURI = (string) hash["server_uri"];
265 m_log.Debug(">> HERE, server_uri: " + region.ServerURI);
266 } 254 }
267 255
268 // Successful return 256 // Successful return
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 0c41935..247dd7e 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -232,14 +232,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
232 m_log.Debug("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); 232 m_log.Debug("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
233 } 233 }
234 // Add the input arguments 234 // Add the input arguments
235 args["gatekeeper_serveruri"] = OSD.FromString(gatekeeper.ServerURI);
236 args["gatekeeper_host"] = OSD.FromString(gatekeeper.ExternalHostName); 235 args["gatekeeper_host"] = OSD.FromString(gatekeeper.ExternalHostName);
237 args["gatekeeper_port"] = OSD.FromString(gatekeeper.HttpPort.ToString()); 236 args["gatekeeper_port"] = OSD.FromString(gatekeeper.HttpPort.ToString());
238 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); 237 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
239 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); 238 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
240 args["destination_name"] = OSD.FromString(destination.RegionName); 239 args["destination_name"] = OSD.FromString(destination.RegionName);
241 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 240 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
242 args["destination_serveruri"] = OSD.FromString(destination.ServerURI);
243 241
244 // 10/3/2010 242 // 10/3/2010
245 // I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here. 243 // I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here.
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
index 4b25ac8..8143b5a 100644
--- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
@@ -84,7 +84,8 @@ namespace OpenSim.Services.Connectors
84 if (info != null) // just to be sure 84 if (info != null) // just to be sure
85 { 85 {
86 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); 86 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
87 XmlRpcResponse response = request.Send(info.ServerURI, 10000); 87 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
88 XmlRpcResponse response = request.Send(uri, 10000);
88 if (response.IsFault) 89 if (response.IsFault)
89 { 90 {
90 m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString); 91 m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString);
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
index 9c57a40..0a982f8 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Services.Connectors
87 87
88 public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion) 88 public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion)
89 { 89 {
90 string uri = region.ServerURI + "/region/" + thisRegion.RegionID + "/"; 90 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/";
91 //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); 91 //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri);
92 92
93 WebRequest HelloNeighbourRequest = WebRequest.Create(uri); 93 WebRequest HelloNeighbourRequest = WebRequest.Create(uri);
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 8076fab..168b233 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -145,6 +145,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
145 Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); 145 Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
146 Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); 146 Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
147 147
148 string httpAddress = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "/";
149
148 OSDMap extraData = new OSDMap 150 OSDMap extraData = new OSDMap
149 { 151 {
150 { "ServerURI", OSD.FromString(regionInfo.ServerURI) }, 152 { "ServerURI", OSD.FromString(regionInfo.ServerURI) },
@@ -166,7 +168,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
166 { "Name", regionInfo.RegionName }, 168 { "Name", regionInfo.RegionName },
167 { "MinPosition", minPosition.ToString() }, 169 { "MinPosition", minPosition.ToString() },
168 { "MaxPosition", maxPosition.ToString() }, 170 { "MaxPosition", maxPosition.ToString() },
169 { "Address", regionInfo.ServerURI }, 171 { "Address", httpAddress },
170 { "Enabled", "1" }, 172 { "Enabled", "1" },
171 { "ExtraData", OSDParser.SerializeJsonString(extraData) } 173 { "ExtraData", OSDParser.SerializeJsonString(extraData) }
172 }; 174 };
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index c4284eb..a5f748f 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Services.Connectors.Simulation
72 72
73 protected virtual string AgentPath() 73 protected virtual string AgentPath()
74 { 74 {
75 return "agent/"; 75 return "/agent/";
76 } 76 }
77 77
78 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) 78 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
@@ -104,7 +104,26 @@ namespace OpenSim.Services.Connectors.Simulation
104 return false; 104 return false;
105 } 105 }
106 106
107 string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; 107 string uri = string.Empty;
108
109 // HACK -- Simian grid make it work!!!
110 if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
111 uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
112 else
113 {
114 try
115 {
116 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
117 }
118 catch (Exception e)
119 {
120 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
121 reason = e.Message;
122 return false;
123 }
124 }
125
126 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
108 127
109 AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri); 128 AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri);
110 AgentCreateRequest.Method = "POST"; 129 AgentCreateRequest.Method = "POST";
@@ -258,7 +277,17 @@ namespace OpenSim.Services.Connectors.Simulation
258 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) 277 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
259 { 278 {
260 // Eventually, we want to use a caps url instead of the agentID 279 // Eventually, we want to use a caps url instead of the agentID
261 string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/"; 280 string uri = string.Empty;
281 try
282 {
283 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + cAgentData.AgentID + "/";
284 }
285 catch (Exception e)
286 {
287 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message);
288 return false;
289 }
290 //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
262 291
263 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); 292 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
264 ChildUpdateRequest.Method = "PUT"; 293 ChildUpdateRequest.Method = "PUT";
@@ -356,7 +385,8 @@ namespace OpenSim.Services.Connectors.Simulation
356 { 385 {
357 agent = null; 386 agent = null;
358 // Eventually, we want to use a caps url instead of the agentID 387 // Eventually, we want to use a caps url instead of the agentID
359 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 388 string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
389 //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
360 390
361 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); 391 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
362 request.Method = "GET"; 392 request.Method = "GET";
@@ -377,6 +407,7 @@ namespace OpenSim.Services.Connectors.Simulation
377 sr = new StreamReader(webResponse.GetResponseStream()); 407 sr = new StreamReader(webResponse.GetResponseStream());
378 reply = sr.ReadToEnd().Trim(); 408 reply = sr.ReadToEnd().Trim();
379 409
410 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was " + reply);
380 411
381 } 412 }
382 catch (WebException ex) 413 catch (WebException ex)
@@ -397,6 +428,7 @@ namespace OpenSim.Services.Connectors.Simulation
397 OSDMap args = Util.GetOSDMap(reply); 428 OSDMap args = Util.GetOSDMap(reply);
398 if (args == null) 429 if (args == null)
399 { 430 {
431 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: Error getting OSDMap from reply");
400 return false; 432 return false;
401 } 433 }
402 434
@@ -405,6 +437,7 @@ namespace OpenSim.Services.Connectors.Simulation
405 return true; 437 return true;
406 } 438 }
407 439
440 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: DoRetrieveRootAgentCall returned status " + webResponse.StatusCode);
408 return false; 441 return false;
409 } 442 }
410 443
@@ -446,8 +479,18 @@ namespace OpenSim.Services.Connectors.Simulation
446 479
447 public bool CloseAgent(GridRegion destination, UUID id) 480 public bool CloseAgent(GridRegion destination, UUID id)
448 { 481 {
449 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 482 string uri = string.Empty;
483 try
484 {
485 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
486 }
487 catch (Exception e)
488 {
489 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message);
490 return false;
491 }
450 492
493 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
451 494
452 WebRequest request = WebRequest.Create(uri); 495 WebRequest request = WebRequest.Create(uri);
453 request.Method = "DELETE"; 496 request.Method = "DELETE";
@@ -495,7 +538,7 @@ namespace OpenSim.Services.Connectors.Simulation
495 public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) 538 public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
496 { 539 {
497 string uri 540 string uri
498 = destination.ServerURI + ObjectPath() + sog.UUID + "/"; 541 = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/";
499 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); 542 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
500 543
501 WebRequest ObjectCreateRequest = WebRequest.Create(uri); 544 WebRequest ObjectCreateRequest = WebRequest.Create(uri);
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 125c2be..e7988d6 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -479,7 +479,7 @@ namespace OpenSim.Services.GridService
479 OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]); 479 OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
480 MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n", 480 MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n",
481 r.RegionName, r.RegionID, 481 r.RegionName, r.RegionID,
482 String.Format("{0},{1}", r.posX, r.posY), r.Data["serverURI"], 482 String.Format("{0},{1}", r.posX, r.posY), "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverPort"].ToString(),
483 r.Data["owner_uuid"].ToString(), flags.ToString())); 483 r.Data["owner_uuid"].ToString(), flags.ToString()));
484 } 484 }
485 return; 485 return;
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index c273d21..b86fb6f 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -126,12 +126,11 @@ namespace OpenSim.Services.GridService
126 126
127 if (MainConsole.Instance != null) 127 if (MainConsole.Instance != null)
128 { 128 {
129 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region <Xloc> <Yloc> <ServerURI> [<RemoteRegionName>]", "Link a HyperGrid Region", RunCommand); 129 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region",
130 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "legacy-link-region", 130 "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
131 "legacy-link-region <Xloc> <Yloc> <RegionIP> <RegionPort> [<RemoteRegionName>]", 131 "Link a hypergrid region", RunCommand);
132 "Link a hypergrid region (deprecated)", RunCommand);
133 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", 132 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region",
134 "unlink-region <local name>", 133 "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
135 "Unlink a hypergrid region", RunCommand); 134 "Unlink a hypergrid region", RunCommand);
136 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", 135 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
137 "Set local coordinate to map HG regions to", RunCommand); 136 "Set local coordinate to map HG regions to", RunCommand);
@@ -199,33 +198,28 @@ namespace OpenSim.Services.GridService
199 198
200 return null; 199 return null;
201 } 200 }
202 201
203 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason) 202
204 { 203 // From the command line and the 2 above
205 return TryCreateLink(scopeID, xloc, yloc, externalRegionName, externalPort, externalHostName, null, out regInfo, out reason); 204 public bool TryCreateLink(UUID scopeID, int xloc, int yloc,
206 } 205 string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason)
207
208 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, string serverURI, out GridRegion regInfo, out string reason)
209 { 206 {
210 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc); 207 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc);
211 208
212 reason = string.Empty; 209 reason = string.Empty;
213 regInfo = new GridRegion(); 210 regInfo = new GridRegion();
214 if ( externalPort > 0) 211 regInfo.RegionName = externalRegionName;
215 regInfo.HttpPort = externalPort; 212 regInfo.HttpPort = externalPort;
216 else 213 regInfo.ExternalHostName = externalHostName;
217 regInfo.HttpPort = 0;
218 if ( externalHostName != null)
219 regInfo.ExternalHostName = externalHostName;
220 else
221 regInfo.ExternalHostName = "0.0.0.0";
222 if ( serverURI != null)
223 regInfo.ServerURI = serverURI;
224
225 regInfo.RegionLocX = xloc; 214 regInfo.RegionLocX = xloc;
226 regInfo.RegionLocY = yloc; 215 regInfo.RegionLocY = yloc;
227 regInfo.ScopeID = scopeID; 216 regInfo.ScopeID = scopeID;
228 217
218 // Big HACK for Simian Grid !!!
219 // We need to clean up all URLs used in OpenSim !!!
220 if (externalHostName.Contains("/"))
221 regInfo.ServerURI = externalHostName;
222
229 try 223 try
230 { 224 {
231 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0); 225 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);
@@ -256,14 +250,9 @@ namespace OpenSim.Services.GridService
256 } 250 }
257 251
258 regInfo.RegionID = regionID; 252 regInfo.RegionID = regionID;
253 if (regInfo.RegionName == string.Empty)
254 regInfo.RegionName = regInfo.ExternalHostName;
259 255
260 if ( externalName == string.Empty )
261 regInfo.RegionName = regInfo.ServerURI;
262 else
263 regInfo.RegionName = externalName;
264
265 m_log.Debug("naming linked region " + regInfo.RegionName);
266
267 // Try get the map image 256 // Try get the map image
268 //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); 257 //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
269 // I need a texture that works for this... the one I tried doesn't seem to be working 258 // I need a texture that works for this... the one I tried doesn't seem to be working
@@ -445,21 +434,6 @@ namespace OpenSim.Services.GridService
445 RunHGCommand(command, cmdparams); 434 RunHGCommand(command, cmdparams);
446 435
447 } 436 }
448
449 private void RunLinkRegionCommand(string[] cmdparams)
450 {
451 int xloc, yloc;
452 string serverURI;
453 string remoteName = null;
454 xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize;
455 yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize;
456 serverURI = cmdparams[2];
457 if (cmdparams.Length == 4)
458 remoteName = cmdparams[3];
459 string reason = string.Empty;
460 GridRegion regInfo;
461 TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, out regInfo, out reason);
462 }
463 437
464 private void RunHGCommand(string command, string[] cmdparams) 438 private void RunHGCommand(string command, string[] cmdparams)
465 { 439 {
@@ -483,18 +457,6 @@ namespace OpenSim.Services.GridService
483 } 457 }
484 else if (command.Equals("link-region")) 458 else if (command.Equals("link-region"))
485 { 459 {
486 if (cmdparams.Length > 0 && cmdparams.Length < 5)
487 {
488 RunLinkRegionCommand(cmdparams);
489 }
490 else
491 {
492 LinkRegionCmdUsage();
493 }
494 return;
495 }
496 else if (command.Equals("legacy-link-region"))
497 {
498 if (cmdparams.Length < 3) 460 if (cmdparams.Length < 3)
499 { 461 {
500 if ((cmdparams.Length == 1) || (cmdparams.Length == 2)) 462 if ((cmdparams.Length == 1) || (cmdparams.Length == 2))
@@ -547,16 +509,12 @@ namespace OpenSim.Services.GridService
547 int xloc, yloc; 509 int xloc, yloc;
548 uint externalPort; 510 uint externalPort;
549 string externalHostName; 511 string externalHostName;
550 string serverURI;
551 try 512 try
552 { 513 {
553 xloc = Convert.ToInt32(cmdparams[0]); 514 xloc = Convert.ToInt32(cmdparams[0]);
554 yloc = Convert.ToInt32(cmdparams[1]); 515 yloc = Convert.ToInt32(cmdparams[1]);
555 externalPort = Convert.ToUInt32(cmdparams[3]); 516 externalPort = Convert.ToUInt32(cmdparams[3]);
556 externalHostName = cmdparams[2]; 517 externalHostName = cmdparams[2];
557 if ( cmdparams.Length == 4 ) {
558
559 }
560 //internalPort = Convert.ToUInt32(cmdparams[4]); 518 //internalPort = Convert.ToUInt32(cmdparams[4]);
561 //remotingPort = Convert.ToUInt32(cmdparams[5]); 519 //remotingPort = Convert.ToUInt32(cmdparams[5]);
562 } 520 }
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 9e96163..3f5c4f1 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -157,7 +157,7 @@ namespace OpenSim.Services.HypergridService
157 string regionimage = "regionImage" + region.RegionID.ToString(); 157 string regionimage = "regionImage" + region.RegionID.ToString();
158 regionimage = regionimage.Replace("-", ""); 158 regionimage = regionimage.Replace("-", "");
159 159
160 imageURL = region.ServerURI + "index.php?method=" + regionimage; 160 imageURL = "http://" + region.ExternalHostName + ":" + region.HttpPort + "/index.php?method=" + regionimage;
161 161
162 return true; 162 return true;
163 } 163 }
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index eb19fe2..eb6433c 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -134,28 +134,23 @@ namespace OpenSim.Services.HypergridService
134 public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason) 134 public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason)
135 { 135 {
136 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", 136 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
137 agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI); 137 agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()),
138 gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort);
138 139
139 m_log.Debug("LATG final server uri -> " + finalDestination.ServerURI );
140 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination 140 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
141 GridRegion region = new GridRegion(gatekeeper); 141 GridRegion region = new GridRegion(gatekeeper);
142 region.ServerURI = gatekeeper.ServerURI;
143 region.ExternalHostName = finalDestination.ExternalHostName;
144 region.InternalEndPoint = finalDestination.InternalEndPoint;
145 region.RegionName = finalDestination.RegionName; 142 region.RegionName = finalDestination.RegionName;
146 region.RegionID = finalDestination.RegionID; 143 region.RegionID = finalDestination.RegionID;
147 region.RegionLocX = finalDestination.RegionLocX; 144 region.RegionLocX = finalDestination.RegionLocX;
148 region.RegionLocY = finalDestination.RegionLocY; 145 region.RegionLocY = finalDestination.RegionLocY;
149 146
150 // Generate a new service session 147 // Generate a new service session
151 agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random(); 148 agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random();
152 TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); 149 TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
153 150
154 m_log.Debug("region ServerURI -> " + region.ServerURI);
155
156 bool success = false; 151 bool success = false;
157 string myExternalIP = string.Empty; 152 string myExternalIP = string.Empty;
158 string gridName = gatekeeper.ServerURI; 153 string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort;
159 if (m_GridName == gridName) 154 if (m_GridName == gridName)
160 success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); 155 success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
161 else 156 else
@@ -164,7 +159,7 @@ namespace OpenSim.Services.HypergridService
164 if (!success) 159 if (!success)
165 { 160 {
166 m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}", 161 m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}",
167 agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason); 162 agentCircuit.firstname, agentCircuit.lastname, region.ExternalHostName + ":" + region.HttpPort, reason);
168 163
169 // restore the old travel info 164 // restore the old travel info
170 lock (m_TravelingAgents) 165 lock (m_TravelingAgents)
@@ -215,7 +210,7 @@ namespace OpenSim.Services.HypergridService
215 m_TravelingAgents[agentCircuit.SessionID] = travel; 210 m_TravelingAgents[agentCircuit.SessionID] = travel;
216 } 211 }
217 travel.UserID = agentCircuit.AgentID; 212 travel.UserID = agentCircuit.AgentID;
218 travel.GridExternalName = region.ServerURI; 213 travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort;
219 travel.ServiceToken = agentCircuit.ServiceSessionID; 214 travel.ServiceToken = agentCircuit.ServiceSessionID;
220 if (old != null) 215 if (old != null)
221 travel.ClientIPAddress = old.ClientIPAddress; 216 travel.ClientIPAddress = old.ClientIPAddress;
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 6d3bff7..77230a3 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -115,20 +115,8 @@ namespace OpenSim.Services.Interfaces
115 /// </summary> 115 /// </summary>
116 public string ServerURI 116 public string ServerURI
117 { 117 {
118 get { 118 get { return m_serverURI; }
119 if ( m_serverURI != string.Empty ) { 119 set { m_serverURI = value; }
120 return m_serverURI;
121 } else {
122 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
123 }
124 }
125 set {
126 if ( value.EndsWith("/") ) {
127 m_serverURI = value;
128 } else {
129 m_serverURI = value + '/';
130 }
131 }
132 } 120 }
133 protected string m_serverURI; 121 protected string m_serverURI;
134 122
@@ -176,7 +164,6 @@ namespace OpenSim.Services.Interfaces
176 164
177 public GridRegion() 165 public GridRegion()
178 { 166 {
179 m_serverURI = string.Empty;
180 } 167 }
181 168
182 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) 169 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index f985ab2..0da1715 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -333,7 +333,34 @@ namespace OpenSim.Services.LLLoginService
333 333
334 private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient) 334 private void FillOutSeedCap(AgentCircuitData aCircuit, GridRegion destination, IPEndPoint ipepClient)
335 { 335 {
336 SeedCapability = destination.ServerURI + CapsUtil.GetCapsSeedPath(aCircuit.CapsPath); 336 string capsSeedPath = String.Empty;
337
338 // Don't use the following! It Fails for logging into any region not on the same port as the http server!
339 // Kept here so it doesn't happen again!
340 // response.SeedCapability = regionInfo.ServerURI + capsSeedPath;
341
342 #region IP Translation for NAT
343 if (ipepClient != null)
344 {
345 capsSeedPath
346 = "http://"
347 + NetworkUtil.GetHostFor(ipepClient.Address, destination.ExternalHostName)
348 + ":"
349 + destination.HttpPort
350 + CapsUtil.GetCapsSeedPath(aCircuit.CapsPath);
351 }
352 else
353 {
354 capsSeedPath
355 = "http://"
356 + destination.ExternalHostName
357 + ":"
358 + destination.HttpPort
359 + CapsUtil.GetCapsSeedPath(aCircuit.CapsPath);
360 }
361 #endregion
362
363 SeedCapability = capsSeedPath;
337 } 364 }
338 365
339 private void SetDefaultValues() 366 private void SetDefaultValues()