mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Add the missing bits for the new region-search:
- Added lookup in the data-layer - MySQL works - SQLite doesn't have a grid-db, so it won't work there - I added MSSQL-code to the best of my knowledge; but I don't know MSSQL :-) - Added the plumbing up to OGS1GridServices. This speaks with the grid-server via XMLRPC. - Modified MapSearchModule to use the new data. It's backward compatible; if used with an old grid-server, it just returns one found region instead of a list. - Refactored a bit. Note: This updates data, grid-server and region code. No new files.
This commit is contained in:
@@ -216,6 +216,33 @@ namespace OpenSim.Data.MSSQL
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns up to maxNum profiles of regions that have a name starting with namePrefix
|
||||
/// </summary>
|
||||
/// <param name="name">The name to match against</param>
|
||||
/// <param name="maxNum">Maximum number of profiles to return</param>
|
||||
/// <returns>A list of sim profiles</returns>
|
||||
override public List<RegionProfileData> GetRegionsByName (string namePrefix, uint maxNum)
|
||||
{
|
||||
using (AutoClosingSqlCommand command = database.Query("SELECT * FROM regions WHERE regionName LIKE @name"))
|
||||
{
|
||||
command.Parameters.Add(database.CreateParameter("name", namePrefix + "%"));
|
||||
|
||||
List<RegionProfileData> rows = new List<RegionProfileData>();
|
||||
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
while (rows.Count < maxNum && reader.Read())
|
||||
{
|
||||
rows.Add(ReadSimRow(reader));
|
||||
}
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sim profile from its location
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user