aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs6
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs2
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs53
3 files changed, 61 insertions, 0 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 5df2e66..8cc1312 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -176,6 +176,12 @@ namespace OpenSim.Region.Communications.Local
176 return null; 176 return null;
177 } 177 }
178 178
179 public RegionInfo RequestClosestRegion(string regionName)
180 {
181 // Don't use this method. It's only for SLURLS and Logins
182 return null;
183 }
184
179 /// <summary> 185 /// <summary>
180 /// 186 ///
181 /// </summary> 187 /// </summary>
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 41f5b3d..eff597e 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -135,6 +135,8 @@ namespace OpenSim.Region.Communications.Local
135 } 135 }
136 else 136 else
137 { 137 {
138 m_log.Info("[LOGIN]: Got Custom Login URL, but can't process it");
139 // LocalBackEndServices can't possibly look up a region by name :(
138 // TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z' 140 // TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z'
139 currentRegion = theUser.currentAgent.currentHandle; 141 currentRegion = theUser.currentAgent.currentHandle;
140 } 142 }
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 05c2721..b7fae65 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -361,6 +361,59 @@ namespace OpenSim.Region.Communications.OGS1
361 return regionInfo; 361 return regionInfo;
362 } 362 }
363 363
364 public RegionInfo RequestClosestRegion(string regionName)
365 {
366 // Don't use this method. It's only for SLURLS and Logins
367 RegionInfo regionInfo = null;
368 try
369 {
370 Hashtable requestData = new Hashtable();
371 requestData["region_name_search"] = regionName;
372 requestData["authkey"] = serversInfo.GridSendKey;
373 ArrayList SendParams = new ArrayList();
374 SendParams.Add(requestData);
375 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
376 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
377
378 Hashtable responseData = (Hashtable) GridResp.Value;
379
380 if (responseData.ContainsKey("error"))
381 {
382 m_log.Error("[OGS1 GRID SERVICES]: Error received from grid server" + responseData["error"]);
383 return null;
384 }
385
386 uint regX = Convert.ToUInt32((string) responseData["region_locx"]);
387 uint regY = Convert.ToUInt32((string) responseData["region_locy"]);
388 string internalIpStr = (string) responseData["sim_ip"];
389 uint port = Convert.ToUInt32(responseData["sim_port"]);
390 string externalUri = (string) responseData["sim_uri"];
391
392 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int) port);
393 string neighbourExternalUri = externalUri;
394 regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr);
395
396 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]);
397 regionInfo.RemotingAddress = internalIpStr;
398
399 regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]);
400 regionInfo.RegionName = (string) responseData["region_name"];
401
402 m_remoteRegionInfoCache.Add(regionInfo.RegionHandle, regionInfo);
403 }
404 catch (WebException)
405 {
406 m_log.Error("[OGS1 GRID SERVICES]: " +
407 "Region lookup failed for: " + regionName +
408 " - Is the GridServer down?");
409 }
410
411
412 return regionInfo;
413
414 }
415
416
364 /// <summary> 417 /// <summary>
365 /// 418 ///
366 /// </summary> 419 /// </summary>