aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MSSQL')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLGridData.cs27
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>