aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.SQLite
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.SQLite
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.SQLite')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteGridData.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
index 6487ba7..4d42f19 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
@@ -112,6 +112,38 @@ namespace OpenSim.Framework.Data.SQLite
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
115 /// Returns a sim profile from it's Region name string
116 /// </summary>
117 /// <param name="uuid">The region name search query</param>
118 /// <returns>The sim profile</returns>
119 public RegionProfileData GetProfileByString(string regionName)
120 {
121 if (regionName.Length > 2)
122 {
123
124 Dictionary<string, string> param = new Dictionary<string, string>();
125 // Add % because this is a like query.
126 param["?regionName"] = regionName + "%";
127 // Only returns one record or no record.
128 IDbCommand result = database.Query("SELECT * FROM regions WHERE regionName like ?regionName LIMIT 1", param);
129 IDataReader reader = result.ExecuteReader();
130
131 RegionProfileData row = database.getRow(reader);
132 reader.Close();
133 result.Dispose();
134
135 return row;
136
137 }
138 else
139 {
140 //m_log.Error("[DATABASE]: Searched for a Region Name shorter then 3 characters");
141 return null;
142 }
143 }
144
145
146 /// <summary>
115 /// Returns a sim profile from it's UUID 147 /// Returns a sim profile from it's UUID
116 /// </summary> 148 /// </summary>
117 /// <param name="uuid">The region UUID</param> 149 /// <param name="uuid">The region UUID</param>