aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-10-22 23:35:01 +0100
committerJustin Clark-Casey (justincc)2010-10-22 23:35:01 +0100
commit8f34e46d7449be1c29419a232a8f7f1e5918f03c (patch)
treee1af6e01bd9be556fe652a32e4ec93c31c80a283
parentRevert "* additional serveruri cleanup" (diff)
downloadopensim-SC-8f34e46d7449be1c29419a232a8f7f1e5918f03c.zip
opensim-SC-8f34e46d7449be1c29419a232a8f7f1e5918f03c.tar.gz
opensim-SC-8f34e46d7449be1c29419a232a8f7f1e5918f03c.tar.bz2
opensim-SC-8f34e46d7449be1c29419a232a8f7f1e5918f03c.tar.xz
Revert "* refactor refactor refactor ServerURI 4 lyfe"
This reverts commit 55974df14b6d64c1e1f9e386a3eacce3ba86dc98.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/RegionInfo.cs8
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs10
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs27
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs2
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs31
-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.cs45
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs14
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs2
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs8
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs8
14 files changed, 94 insertions, 72 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 949a289..08d5398 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -116,13 +116,7 @@ namespace OpenSim.Framework
116 public string ServerURI 116 public string ServerURI
117 { 117 {
118 get { return m_serverURI; } 118 get { return m_serverURI; }
119 set { 119 set { m_serverURI = value; }
120 if ( value.EndsWith("/") ) {
121 m_serverURI = value;
122 } else {
123 m_serverURI = value + '/';
124 }
125 }
126 } 120 }
127 protected string m_serverURI; 121 protected string m_serverURI;
128 122
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 47e86ad..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,11 +376,11 @@ 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 {
383 m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler"); 383 //m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler");
384 // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. 384 // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
385 byte[] buffer = null; 385 byte[] buffer = null;
386 386
@@ -395,7 +395,7 @@ namespace OpenSim.Framework.Servers.HttpServer
395 } 395 }
396 else if (requestHandler is IGenericHTTPHandler) 396 else if (requestHandler is IGenericHTTPHandler)
397 { 397 {
398 m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler"); 398 //m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler");
399 IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler; 399 IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler;
400 Stream requestStream = request.InputStream; 400 Stream requestStream = request.InputStream;
401 401
@@ -422,7 +422,7 @@ namespace OpenSim.Framework.Servers.HttpServer
422 422
423 foreach (string headername in rHeaders) 423 foreach (string headername in rHeaders)
424 { 424 {
425 m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]); 425 //m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]);
426 headervals[headername] = request.Headers[headername]; 426 headervals[headername] = request.Headers[headername];
427 } 427 }
428 428
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f30a850..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/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 3791e1d..38fff1c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -337,11 +337,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
337 if (sp.ClientView.TryGet(out ipepClient)) 337 if (sp.ClientView.TryGet(out ipepClient))
338 { 338 {
339 capsPath 339 capsPath
340 = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 340 = "http://"
341 + NetworkUtil.GetHostFor(ipepClient.EndPoint, finalDestination.ExternalHostName)
342 + ":"
343 + finalDestination.HttpPort
344 + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
341 } 345 }
342 else 346 else
343 { 347 {
344 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 348 capsPath
349 = "http://"
350 + finalDestination.ExternalHostName
351 + ":"
352 + finalDestination.HttpPort
353 + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
345 } 354 }
346 #endregion 355 #endregion
347 356
@@ -373,7 +382,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
373 else 382 else
374 { 383 {
375 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); 384 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
376 capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/"; 385 capsPath = "http://" + finalDestination.ExternalHostName + ":" + finalDestination.HttpPort
386 + "/CAPS/" + agentCircuit.CapsPath + "0000/";
377 } 387 }
378 388
379 // Expect avatar crossing is a heavy-duty function at the destination. 389 // Expect avatar crossing is a heavy-duty function at the destination.
@@ -506,7 +516,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
506 516
507 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) 517 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
508 { 518 {
509 agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; 519 agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort +
520 "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
510 521
511 } 522 }
512 523
@@ -831,7 +842,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
831 cAgent.Position = pos; 842 cAgent.Position = pos;
832 if (isFlying) 843 if (isFlying)
833 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 844 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
834 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + 845 cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort +
835 "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; 846 "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
836 847
837 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) 848 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
@@ -859,7 +870,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
859 } 870 }
860 // TODO Should construct this behind a method 871 // TODO Should construct this behind a method
861 string capsPath = 872 string capsPath =
862 neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; 873 "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort
874 + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
863 875
864 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);
865 877
@@ -1178,7 +1190,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1178 y = y / Constants.RegionSize; 1190 y = y / Constants.RegionSize;
1179 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() + ")");
1180 1192
1181 string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/"; 1193 string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort
1194 + "/CAPS/" + a.CapsPath + "0000/";
1182 1195
1183 string reason = String.Empty; 1196 string reason = String.Empty;
1184 1197
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 3ce964a..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(
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 89a8f7a..479a80e 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -108,8 +108,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
108 } 108 }
109 109
110 hash = (Hashtable)response.Value; 110 hash = (Hashtable)response.Value;
111 foreach (Object o in hash) 111 //foreach (Object o in hash)
112 m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); 112 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
113 try 113 try
114 { 114 {
115 bool success = false; 115 bool success = false;
@@ -117,20 +117,16 @@ namespace OpenSim.Services.Connectors.Hypergrid
117 if (success) 117 if (success)
118 { 118 {
119 UUID.TryParse((string)hash["uuid"], out regionID); 119 UUID.TryParse((string)hash["uuid"], out regionID);
120 m_log.Debug(">> HERE, uuid: " + regionID); 120 //m_log.Debug(">> HERE, uuid: " + uuid);
121 if ((string)hash["handle"] != null) 121 if ((string)hash["handle"] != null)
122 { 122 {
123 realHandle = Convert.ToUInt64((string)hash["handle"]); 123 realHandle = Convert.ToUInt64((string)hash["handle"]);
124 m_log.Debug(">> HERE, realHandle: " + realHandle); 124 //m_log.Debug(">> HERE, realHandle: " + realHandle);
125 } 125 }
126 if (hash["region_image"] != null) { 126 if (hash["region_image"] != null)
127 imageURL = (string)hash["region_image"]; 127 imageURL = (string)hash["region_image"];
128 m_log.Debug(">> HERE, imageURL: " + imageURL); 128 if (hash["external_name"] != null)
129 }
130 if (hash["external_name"] != null) {
131 externalName = (string)hash["external_name"]; 129 externalName = (string)hash["external_name"];
132 m_log.Debug(">> HERE, externalName: " + externalName);
133 }
134 } 130 }
135 131
136 } 132 }
@@ -212,8 +208,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
212 } 208 }
213 209
214 hash = (Hashtable)response.Value; 210 hash = (Hashtable)response.Value;
215 foreach (Object o in hash) 211 //foreach (Object o in hash)
216 m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); 212 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
217 try 213 try
218 { 214 {
219 bool success = false; 215 bool success = false;
@@ -223,41 +219,38 @@ namespace OpenSim.Services.Connectors.Hypergrid
223 GridRegion region = new GridRegion(); 219 GridRegion region = new GridRegion();
224 220
225 UUID.TryParse((string)hash["uuid"], out region.RegionID); 221 UUID.TryParse((string)hash["uuid"], out region.RegionID);
226 m_log.Debug(">> HERE, uuid: " + region.RegionID); 222 //m_log.Debug(">> HERE, uuid: " + region.RegionID);
227 int n = 0; 223 int n = 0;
228 if (hash["x"] != null) 224 if (hash["x"] != null)
229 { 225 {
230 Int32.TryParse((string)hash["x"], out n); 226 Int32.TryParse((string)hash["x"], out n);
231 region.RegionLocX = n; 227 region.RegionLocX = n;
232 m_log.Debug(">> HERE, x: " + region.RegionLocX); 228 //m_log.Debug(">> HERE, x: " + region.RegionLocX);
233 } 229 }
234 if (hash["y"] != null) 230 if (hash["y"] != null)
235 { 231 {
236 Int32.TryParse((string)hash["y"], out n); 232 Int32.TryParse((string)hash["y"], out n);
237 region.RegionLocY = n; 233 region.RegionLocY = n;
238 m_log.Debug(">> HERE, y: " + region.RegionLocY); 234 //m_log.Debug(">> HERE, y: " + region.RegionLocY);
239 } 235 }
240 if (hash["region_name"] != null) 236 if (hash["region_name"] != null)
241 { 237 {
242 region.RegionName = (string)hash["region_name"]; 238 region.RegionName = (string)hash["region_name"];
243 m_log.Debug(">> HERE, region_name: " + region.RegionName); 239 //m_log.Debug(">> HERE, name: " + region.RegionName);
244 } 240 }
245 if (hash["hostname"] != null) 241 if (hash["hostname"] != null)
246 region.ExternalHostName = (string)hash["hostname"]; 242 region.ExternalHostName = (string)hash["hostname"];
247 m_log.Debug(">> HERE, hostname: " + region.ExternalHostName);
248 if (hash["http_port"] != null) 243 if (hash["http_port"] != null)
249 { 244 {
250 uint p = 0; 245 uint p = 0;
251 UInt32.TryParse((string)hash["http_port"], out p); 246 UInt32.TryParse((string)hash["http_port"], out p);
252 region.HttpPort = p; 247 region.HttpPort = p;
253 m_log.Debug(">> HERE, http_port: " + region.HttpPort);
254 } 248 }
255 if (hash["internal_port"] != null) 249 if (hash["internal_port"] != null)
256 { 250 {
257 int p = 0; 251 int p = 0;
258 Int32.TryParse((string)hash["internal_port"], out p); 252 Int32.TryParse((string)hash["internal_port"], out p);
259 region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); 253 region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p);
260 m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint);
261 } 254 }
262 255
263 // Successful return 256 // Successful return
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 07839d3..a5f748f 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -104,7 +104,24 @@ 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 }
108 125
109 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); 126 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
110 127
@@ -260,7 +277,16 @@ namespace OpenSim.Services.Connectors.Simulation
260 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) 277 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
261 { 278 {
262 // 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
263 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 }
264 //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri); 290 //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
265 291
266 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); 292 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
@@ -359,7 +385,7 @@ namespace OpenSim.Services.Connectors.Simulation
359 { 385 {
360 agent = null; 386 agent = null;
361 // 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
362 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 388 string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
363 //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri); 389 //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
364 390
365 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); 391 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
@@ -453,7 +479,16 @@ namespace OpenSim.Services.Connectors.Simulation
453 479
454 public bool CloseAgent(GridRegion destination, UUID id) 480 public bool CloseAgent(GridRegion destination, UUID id)
455 { 481 {
456 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 }
457 492
458 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri); 493 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
459 494
@@ -503,7 +538,7 @@ namespace OpenSim.Services.Connectors.Simulation
503 public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) 538 public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
504 { 539 {
505 string uri 540 string uri
506 = destination.ServerURI + ObjectPath() + sog.UUID + "/"; 541 = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/";
507 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); 542 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
508 543
509 WebRequest ObjectCreateRequest = WebRequest.Create(uri); 544 WebRequest ObjectCreateRequest = WebRequest.Create(uri);
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 757ae80..b86fb6f 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -127,7 +127,7 @@ namespace OpenSim.Services.GridService
127 if (MainConsole.Instance != null) 127 if (MainConsole.Instance != null)
128 { 128 {
129 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", 129 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region",
130 "link-region <Xloc> <Yloc> <RegionIP> <RegionPort> [<RegionServerURI] [<RemoteRegionName>] <cr>", 130 "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
131 "Link a hypergrid region", RunCommand); 131 "Link a hypergrid region", RunCommand);
132 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", 132 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region",
133 "unlink-region <local name> or <HostName>:<HttpPort> <cr>", 133 "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
@@ -200,15 +200,9 @@ namespace OpenSim.Services.GridService
200 } 200 }
201 201
202 202
203 public bool TryCreateLink(UUID scopeID, int xloc, int yloc,
204 string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason)
205 {
206 TryCreateLink(scopeID, xloc, yloc, externalRegionName, externalPort, externalHostName, null, regInfo, reason);
207 }
208
209 // From the command line and the 2 above 203 // From the command line and the 2 above
210 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, 204 public bool TryCreateLink(UUID scopeID, int xloc, int yloc,
211 string externalRegionName, uint externalPort, string externalHostName, string serverURI, out GridRegion regInfo, out string reason) 205 string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason)
212 { 206 {
213 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);
214 208
@@ -515,16 +509,12 @@ namespace OpenSim.Services.GridService
515 int xloc, yloc; 509 int xloc, yloc;
516 uint externalPort; 510 uint externalPort;
517 string externalHostName; 511 string externalHostName;
518 string serverURI;
519 try 512 try
520 { 513 {
521 xloc = Convert.ToInt32(cmdparams[0]); 514 xloc = Convert.ToInt32(cmdparams[0]);
522 yloc = Convert.ToInt32(cmdparams[1]); 515 yloc = Convert.ToInt32(cmdparams[1]);
523 externalPort = Convert.ToUInt32(cmdparams[3]); 516 externalPort = Convert.ToUInt32(cmdparams[3]);
524 externalHostName = cmdparams[2]; 517 externalHostName = cmdparams[2];
525 if ( cmdparams.Length == 4 ) {
526
527 }
528 //internalPort = Convert.ToUInt32(cmdparams[4]); 518 //internalPort = Convert.ToUInt32(cmdparams[4]);
529 //remotingPort = Convert.ToUInt32(cmdparams[5]); 519 //remotingPort = Convert.ToUInt32(cmdparams[5]);
530 } 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 d5dda11..eb6433c 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -145,12 +145,12 @@ namespace OpenSim.Services.HypergridService
145 region.RegionLocY = finalDestination.RegionLocY; 145 region.RegionLocY = finalDestination.RegionLocY;
146 146
147 // Generate a new service session 147 // Generate a new service session
148 agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random(); 148 agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random();
149 TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); 149 TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
150 150
151 bool success = false; 151 bool success = false;
152 string myExternalIP = string.Empty; 152 string myExternalIP = string.Empty;
153 string gridName = gatekeeper.ServerURI; 153 string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort;
154 if (m_GridName == gridName) 154 if (m_GridName == gridName)
155 success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); 155 success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
156 else 156 else
@@ -159,7 +159,7 @@ namespace OpenSim.Services.HypergridService
159 if (!success) 159 if (!success)
160 { 160 {
161 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}",
162 agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason); 162 agentCircuit.firstname, agentCircuit.lastname, region.ExternalHostName + ":" + region.HttpPort, reason);
163 163
164 // restore the old travel info 164 // restore the old travel info
165 lock (m_TravelingAgents) 165 lock (m_TravelingAgents)
@@ -210,7 +210,7 @@ namespace OpenSim.Services.HypergridService
210 m_TravelingAgents[agentCircuit.SessionID] = travel; 210 m_TravelingAgents[agentCircuit.SessionID] = travel;
211 } 211 }
212 travel.UserID = agentCircuit.AgentID; 212 travel.UserID = agentCircuit.AgentID;
213 travel.GridExternalName = region.ServerURI; 213 travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort;
214 travel.ServiceToken = agentCircuit.ServiceSessionID; 214 travel.ServiceToken = agentCircuit.ServiceSessionID;
215 if (old != null) 215 if (old != null)
216 travel.ClientIPAddress = old.ClientIPAddress; 216 travel.ClientIPAddress = old.ClientIPAddress;
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index bf441e6..77230a3 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -116,13 +116,7 @@ namespace OpenSim.Services.Interfaces
116 public string ServerURI 116 public string ServerURI
117 { 117 {
118 get { return m_serverURI; } 118 get { return m_serverURI; }
119 set { 119 set { m_serverURI = value; }
120 if ( value.EndsWith("/") ) {
121 m_serverURI = value;
122 } else {
123 m_serverURI = value + '/';
124 }
125 }
126 } 120 }
127 protected string m_serverURI; 121 protected string m_serverURI;
128 122