diff options
author | Homer Horwitz | 2008-10-03 23:00:42 +0000 |
---|---|---|
committer | Homer Horwitz | 2008-10-03 23:00:42 +0000 |
commit | 16d68749a457acf079a6737f4ca9a9adb9e53e2f (patch) | |
tree | 901b2c31e53eeb97f30ac46f2b7f406a01e1755a /OpenSim/Data/MSSQL | |
parent | Fix: Mantis#2326: Fix: privilege escalation through attach from ground (diff) | |
download | opensim-SC-16d68749a457acf079a6737f4ca9a9adb9e53e2f.zip opensim-SC-16d68749a457acf079a6737f4ca9a9adb9e53e2f.tar.gz opensim-SC-16d68749a457acf079a6737f4ca9a9adb9e53e2f.tar.bz2 opensim-SC-16d68749a457acf079a6737f4ca9a9adb9e53e2f.tar.xz |
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.
Diffstat (limited to 'OpenSim/Data/MSSQL')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLGridData.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index 443116a..6f94980 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs | |||
@@ -216,6 +216,33 @@ namespace OpenSim.Data.MSSQL | |||
216 | return null; | 216 | return null; |
217 | } | 217 | } |
218 | 218 | ||
219 | |||
220 | /// <summary> | ||
221 | /// Returns up to maxNum profiles of regions that have a name starting with namePrefix | ||
222 | /// </summary> | ||
223 | /// <param name="name">The name to match against</param> | ||
224 | /// <param name="maxNum">Maximum number of profiles to return</param> | ||
225 | /// <returns>A list of sim profiles</returns> | ||
226 | override public List<RegionProfileData> GetRegionsByName (string namePrefix, uint maxNum) | ||
227 | { | ||
228 | using (AutoClosingSqlCommand command = database.Query("SELECT * FROM regions WHERE regionName LIKE @name")) | ||
229 | { | ||
230 | command.Parameters.Add(database.CreateParameter("name", namePrefix + "%")); | ||
231 | |||
232 | List<RegionProfileData> rows = new List<RegionProfileData>(); | ||
233 | |||
234 | using (SqlDataReader reader = command.ExecuteReader()) | ||
235 | { | ||
236 | while (rows.Count < maxNum && reader.Read()) | ||
237 | { | ||
238 | rows.Add(ReadSimRow(reader)); | ||
239 | } | ||
240 | } | ||
241 | |||
242 | return rows; | ||
243 | } | ||
244 | } | ||
245 | |||
219 | /// <summary> | 246 | /// <summary> |
220 | /// Returns a sim profile from its location | 247 | /// Returns a sim profile from its location |
221 | /// </summary> | 248 | /// </summary> |