aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-03-18 05:44:25 +0000
committerTeravus Ovares2008-03-18 05:44:25 +0000
commit42857fe4e9e898c8e350da2f9acb3b252b31694a (patch)
treede55ab7f5d6d6e1bb127a39f6e97f67e4e442cf4 /OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
parentFormatting cleanup. (diff)
downloadopensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.zip
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.gz
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.bz2
opensim-SC_OLD-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.xz
* 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.
Diffstat (limited to 'OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs')
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
index 2b91cf9..38a1d08 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
@@ -180,6 +180,49 @@ namespace OpenSim.Framework.Data.MSSQL
180 return row; 180 return row;
181 } 181 }
182 182
183
184 /// <summary>
185 /// Returns a sim profile from it's Region name string
186 /// </summary>
187 /// <param name="uuid">The region name search query</param>
188 /// <returns>The sim profile</returns>
189 public RegionProfileData GetProfileByString(string regionName)
190 {
191 if (regionName.Length > 2)
192 {
193 try
194 {
195 lock (database)
196 {
197 Dictionary<string, string> param = new Dictionary<string, string>();
198 // Add % because this is a like query.
199 param["?regionName"] = regionName + "%";
200 // Order by statement will return shorter matches first. Only returns one record or no record.
201 IDbCommand result = database.Query("SELECT top 1 * FROM " + m_regionsTableName + " WHERE regionName like ?regionName order by regionName", param);
202 IDataReader reader = result.ExecuteReader();
203
204 RegionProfileData row = database.getRegionRow(reader);
205 reader.Close();
206 result.Dispose();
207
208 return row;
209 }
210 }
211 catch (Exception e)
212 {
213 database.Reconnect();
214 m_log.Error(e.ToString());
215 return null;
216 }
217 }
218 else
219 {
220 m_log.Error("[DATABASE]: Searched for a Region Name shorter then 3 characters");
221 return null;
222 }
223 }
224
225
183 /// <summary> 226 /// <summary>
184 /// Adds a new specified region to the database 227 /// Adds a new specified region to the database
185 /// </summary> 228 /// </summary>