aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/OGS1
diff options
context:
space:
mode:
authorTeravus Ovares2008-03-18 05:44:25 +0000
committerTeravus Ovares2008-03-18 05:44:25 +0000
commit42857fe4e9e898c8e350da2f9acb3b252b31694a (patch)
treede55ab7f5d6d6e1bb127a39f6e97f67e4e442cf4 /OpenSim/Region/Communications/OGS1
parentFormatting cleanup. (diff)
downloadopensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.zip
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.gz
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.bz2
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.xz
* Added the ability to type the partial name of a region in the start location box and go to that region if it's there. If no close match was found, it sends you home. This is tested on mySQL. There's untested code on grids that are based on sqlite and MSSQL. The SQL statements *should* be right, but your results may very.
* Ex, if you want to go to Wright Plaza, you simply need to type Wright Plaza in the start location in the client when you log-in.
Diffstat (limited to 'OpenSim/Region/Communications/OGS1')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs53
1 files changed, 53 insertions, 0 deletions
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>