aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-13 22:48:19 +0000
committerTeravus Ovares2007-11-13 22:48:19 +0000
commit9f6b3e2357e76b9b85b447da189b4bf4163edd3c (patch)
tree7d9c39258e45e6271db953608e6868433f9ac70d /OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
parentfirst pass on unlinking of objects. From Jay Clarke (IBM) (diff)
downloadopensim-SC_OLD-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.zip
opensim-SC_OLD-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.tar.gz
opensim-SC_OLD-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.tar.bz2
opensim-SC_OLD-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.tar.xz
* Added AvatarPicker in Standalone mode. Works for finding avatar to ban, manually trying to add a friend (with the add button) or useful to those who are curious which usernames have visited your standalone sim. Important for future development :D.
* Grid mode always returns 0 results until the Grid Communications portion is done.
Diffstat (limited to 'OpenSim/Framework/Data.SQLite/SQLiteUserData.cs')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteUserData.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
index d7a6b39..1385ffc 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
@@ -26,16 +26,22 @@
26* 26*
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic;
29using System.Data; 30using System.Data;
30using libsecondlife; 31using libsecondlife;
31using Mono.Data.SqliteClient; 32using Mono.Data.SqliteClient;
33using OpenSim.Framework;
32using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
33 35
36
34namespace OpenSim.Framework.Data.SQLite 37namespace OpenSim.Framework.Data.SQLite
35{ 38{
36 /// <summary> 39 /// <summary>
37 /// A User storage interface for the DB4o database system 40 /// A User storage interface for the DB4o database system
38 /// </summary> 41 /// </summary>
42 ///
43
44
39 public class SQLiteUserData : SQLiteBase, IUserData 45 public class SQLiteUserData : SQLiteBase, IUserData
40 { 46 {
41 /// <summary> 47 /// <summary>
@@ -135,6 +141,53 @@ namespace OpenSim.Framework.Data.SQLite
135 } 141 }
136 } 142 }
137 143
144 public List<OpenSim.Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
145 {
146 List<OpenSim.Framework.AvatarPickerAvatar> returnlist = new List<OpenSim.Framework.AvatarPickerAvatar>();
147 string[] querysplit;
148 querysplit = query.Split(' ');
149 if (querysplit.Length == 2)
150 {
151 string select = "username like '" + querysplit[0] + "%' and surname like '" + querysplit[1] + "%'";
152 lock(ds)
153 {
154 DataRow[] rows = ds.Tables["users"].Select(select);
155 if (rows.Length > 0)
156 {
157 for (int i = 0; i < rows.Length; i++)
158 {
159 OpenSim.Framework.AvatarPickerAvatar user = new OpenSim.Framework.AvatarPickerAvatar();
160 DataRow row = rows[i];
161 user.AvatarID = new LLUUID((string)row["UUID"]);
162 user.firstName = (string)row["username"];
163 user.lastName = (string)row["surname"];
164 returnlist.Add(user);
165 }
166 }
167 }
168 }
169 else if (querysplit.Length == 1)
170 {
171
172 string select = "username like '" + querysplit[0] + "%' OR surname like '" + querysplit[0] + "%'";
173 lock(ds)
174 {
175 DataRow[] rows = ds.Tables["users"].Select(select);
176 if (rows.Length > 0)
177 {
178 for (int i = 0;i<rows.Length;i++) {
179 OpenSim.Framework.AvatarPickerAvatar user = new OpenSim.Framework.AvatarPickerAvatar();
180 DataRow row = rows[i];
181 user.AvatarID = new LLUUID((string)row[0]);
182 user.firstName = (string)row[1];
183 user.lastName = (string)row[2];
184 returnlist.Add(user);
185 }
186 }
187 }
188 }
189 return returnlist;
190 }
138 /// <summary> 191 /// <summary>
139 /// Returns a user by UUID direct 192 /// Returns a user by UUID direct
140 /// </summary> 193 /// </summary>