* 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.
This commit is contained in:
Teravus Ovares
2008-03-18 05:44:25 +00:00
parent 47180080f0
commit 42857fe4e9
13 changed files with 338 additions and 5 deletions

View File

@@ -176,6 +176,12 @@ namespace OpenSim.Region.Communications.Local
return null;
}
public RegionInfo RequestClosestRegion(string regionName)
{
// Don't use this method. It's only for SLURLS and Logins
return null;
}
/// <summary>
///
/// </summary>

View File

@@ -135,6 +135,8 @@ namespace OpenSim.Region.Communications.Local
}
else
{
m_log.Info("[LOGIN]: Got Custom Login URL, but can't process it");
// LocalBackEndServices can't possibly look up a region by name :(
// TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z'
currentRegion = theUser.currentAgent.currentHandle;
}

View File

@@ -361,6 +361,59 @@ namespace OpenSim.Region.Communications.OGS1
return regionInfo;
}
public RegionInfo RequestClosestRegion(string regionName)
{
// Don't use this method. It's only for SLURLS and Logins
RegionInfo regionInfo = null;
try
{
Hashtable requestData = new Hashtable();
requestData["region_name_search"] = regionName;
requestData["authkey"] = serversInfo.GridSendKey;
ArrayList SendParams = new ArrayList();
SendParams.Add(requestData);
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
Hashtable responseData = (Hashtable) GridResp.Value;
if (responseData.ContainsKey("error"))
{
m_log.Error("[OGS1 GRID SERVICES]: Error received from grid server" + responseData["error"]);
return null;
}
uint regX = Convert.ToUInt32((string) responseData["region_locx"]);
uint regY = Convert.ToUInt32((string) responseData["region_locy"]);
string internalIpStr = (string) responseData["sim_ip"];
uint port = Convert.ToUInt32(responseData["sim_port"]);
string externalUri = (string) responseData["sim_uri"];
IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int) port);
string neighbourExternalUri = externalUri;
regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr);
regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]);
regionInfo.RemotingAddress = internalIpStr;
regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]);
regionInfo.RegionName = (string) responseData["region_name"];
m_remoteRegionInfoCache.Add(regionInfo.RegionHandle, regionInfo);
}
catch (WebException)
{
m_log.Error("[OGS1 GRID SERVICES]: " +
"Region lookup failed for: " + regionName +
" - Is the GridServer down?");
}
return regionInfo;
}
/// <summary>
///
/// </summary>