diff options
author | Teravus Ovares | 2007-11-13 22:48:19 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-13 22:48:19 +0000 |
commit | 9f6b3e2357e76b9b85b447da189b4bf4163edd3c (patch) | |
tree | 7d9c39258e45e6271db953608e6868433f9ac70d /OpenSim/Framework/Data.SQLite | |
parent | first pass on unlinking of objects. From Jay Clarke (IBM) (diff) | |
download | opensim-SC-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.zip opensim-SC-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.tar.gz opensim-SC-9f6b3e2357e76b9b85b447da189b4bf4163edd3c.tar.bz2 opensim-SC-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')
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteGridData.cs | 11 | ||||
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | 53 |
2 files changed, 63 insertions, 1 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs index 8f3e8aa..b8fc639 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs | |||
@@ -130,7 +130,16 @@ namespace OpenSim.Framework.Data.SQLite | |||
130 | 130 | ||
131 | return row; | 131 | return row; |
132 | } | 132 | } |
133 | 133 | /// <summary> | |
134 | /// // Returns a list of avatar and UUIDs that match the query | ||
135 | /// </summary> | ||
136 | |||
137 | public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) | ||
138 | { | ||
139 | //Do nothing yet | ||
140 | List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>(); | ||
141 | return returnlist; | ||
142 | } | ||
134 | /// <summary> | 143 | /// <summary> |
135 | /// Adds a new specified region to the database | 144 | /// Adds a new specified region to the database |
136 | /// </summary> | 145 | /// </summary> |
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 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | ||
29 | using System.Data; | 30 | using System.Data; |
30 | using libsecondlife; | 31 | using libsecondlife; |
31 | using Mono.Data.SqliteClient; | 32 | using Mono.Data.SqliteClient; |
33 | using OpenSim.Framework; | ||
32 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
33 | 35 | ||
36 | |||
34 | namespace OpenSim.Framework.Data.SQLite | 37 | namespace 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> |