* 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

@@ -164,6 +164,27 @@ namespace OpenSim.Grid.GridServer
return null;
}
/// <summary>
/// Returns a region by argument
/// </summary>
/// <param name="regionName">A partial regionName of the region to return</param>
/// <returns>A SimProfileData for the region</returns>
public RegionProfileData getRegion(string regionName)
{
foreach (KeyValuePair<string, IGridData> kvp in _plugins)
{
try
{
return kvp.Value.GetProfileByString(regionName);
}
catch
{
m_log.Warn("[storage]: Unable to find region " + regionName + " via " + kvp.Key);
}
}
return null;
}
public Dictionary<ulong, RegionProfileData> getRegions(uint xmin, uint ymin, uint xmax, uint ymax)
{
Dictionary<ulong, RegionProfileData> regions = new Dictionary<ulong, RegionProfileData>();
@@ -615,6 +636,10 @@ namespace OpenSim.Grid.GridServer
//CFK: Console.WriteLine("requesting data for region " + (string) requestData["region_handle"]);
simData = getRegion(Convert.ToUInt64((string)requestData["region_handle"]));
}
else if (requestData.ContainsKey("region_name_search"))
{
simData = getRegion((string)requestData["region_name_search"]);
}
if (simData == null)
{