diff options
author | Teravus Ovares | 2007-12-04 16:07:59 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-04 16:07:59 +0000 |
commit | a553e6f67ce2595868ceba0184f730af640961cf (patch) | |
tree | 38de3c5b956d829064e541f671a5d8f0b2d935f4 /OpenSim/Framework/Data.MySQL/MySQLGridData.cs | |
parent | * ApplyPhysics now creates the PhysActor as well. (diff) | |
download | opensim-SC-a553e6f67ce2595868ceba0184f730af640961cf.zip opensim-SC-a553e6f67ce2595868ceba0184f730af640961cf.tar.gz opensim-SC-a553e6f67ce2595868ceba0184f730af640961cf.tar.bz2 opensim-SC-a553e6f67ce2595868ceba0184f730af640961cf.tar.xz |
* Avatar picker works in grid mode now.
* To test, click the communicate button, then click the 'add' button and type a name. You will get a list of closely matching avatar names.
* Before this'll work on your sim in grid mode, the UGA needs to be updated. If it isn't updated, then you'll get a message on the sim console when searching like, 'got invalid queryid'.
Diffstat (limited to 'OpenSim/Framework/Data.MySQL/MySQLGridData.cs')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLGridData.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs index 930b3f4..4d65ee9 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs | |||
@@ -176,20 +176,24 @@ namespace OpenSim.Framework.Data.MySQL | |||
176 | public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) | 176 | public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) |
177 | { | 177 | { |
178 | List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>(); | 178 | List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>(); |
179 | |||
180 | System.Text.RegularExpressions.Regex objAlphaNumericPattern = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9]"); | ||
181 | |||
179 | string[] querysplit; | 182 | string[] querysplit; |
180 | querysplit = query.Split(' '); | 183 | querysplit = query.Split(' '); |
181 | if (querysplit.Length == 2) | 184 | if (querysplit.Length == 2) |
182 | { | 185 | { |
186 | Dictionary<string, string> param = new Dictionary<string, string>(); | ||
187 | param["?first"] = objAlphaNumericPattern.Replace(querysplit[0],"") + "%"; | ||
188 | param["?second"] = objAlphaNumericPattern.Replace(querysplit[1], "") + "%"; | ||
183 | try | 189 | try |
184 | { | 190 | { |
185 | lock (database) | 191 | lock (database) |
186 | { | 192 | { |
187 | Dictionary<string, string> param = new Dictionary<string, string>(); | 193 | |
188 | param["?first"] = querysplit[0]; | ||
189 | param["?second"] = querysplit[1]; | ||
190 | 194 | ||
191 | IDbCommand result = | 195 | IDbCommand result = |
192 | database.Query("SELECT UUID,username,surname FROM users WHERE username = ?first AND lastname = ?second", param); | 196 | database.Query("SELECT UUID,username,surname FROM users WHERE username like ?first AND lastname like ?second LIMIT 100", param); |
193 | IDataReader reader = result.ExecuteReader(); | 197 | IDataReader reader = result.ExecuteReader(); |
194 | 198 | ||
195 | 199 | ||
@@ -224,11 +228,10 @@ namespace OpenSim.Framework.Data.MySQL | |||
224 | lock (database) | 228 | lock (database) |
225 | { | 229 | { |
226 | Dictionary<string, string> param = new Dictionary<string, string>(); | 230 | Dictionary<string, string> param = new Dictionary<string, string>(); |
227 | param["?first"] = querysplit[0]; | 231 | param["?first"] = objAlphaNumericPattern.Replace(querysplit[0],"") + "%"; |
228 | param["?second"] = querysplit[1]; | ||
229 | 232 | ||
230 | IDbCommand result = | 233 | IDbCommand result = |
231 | database.Query("SELECT UUID,username,surname FROM users WHERE username = ?first OR lastname = ?second", param); | 234 | database.Query("SELECT UUID,username,surname FROM users WHERE username like ?first OR lastname like ?second", param); |
232 | IDataReader reader = result.ExecuteReader(); | 235 | IDataReader reader = result.ExecuteReader(); |
233 | 236 | ||
234 | 237 | ||