aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs10
-rw-r--r--OpenSim/Framework/Communications/IGridServices.cs1
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs19
-rw-r--r--OpenSim/Framework/Data.DB4o/DB4oGridData.cs10
-rw-r--r--OpenSim/Framework/Data.DB4o/DB4oUserData.cs8
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs13
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLGridData.cs85
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLUserData.cs81
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteGridData.cs11
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteUserData.cs53
-rw-r--r--OpenSim/Framework/Data/GridData.cs12
-rw-r--r--OpenSim/Framework/IClientAPI.cs3
-rw-r--r--OpenSim/Framework/IUserData.cs12
-rw-r--r--OpenSim/Framework/IUserService.cs2
-rw-r--r--OpenSim/Framework/UserProfileData.cs13
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs5
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs11
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs15
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs39
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs4
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs4
23 files changed, 413 insertions, 11 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 77c7261..7b1a97e 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using libsecondlife; 29using libsecondlife;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Framework.Communications.Cache;
31using System.Collections.Generic;
31using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
32using OpenSim.Framework.Interfaces; 33using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Servers; 34using OpenSim.Framework.Servers;
@@ -173,6 +174,15 @@ namespace OpenSim.Framework.Communications
173 } 174 }
174 } 175 }
175 } 176 }
177 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query)
178 {
179
180
181 List<AvatarPickerAvatar> pickerlist = m_userService.GenerateAgentPickerRequestResponse(queryID, query);
182
183
184 return pickerlist;
185 }
176 186
177 #endregion 187 #endregion
178 } 188 }
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs
index ce6205f..3d0af09 100644
--- a/OpenSim/Framework/Communications/IGridServices.cs
+++ b/OpenSim/Framework/Communications/IGridServices.cs
@@ -36,5 +36,6 @@ namespace OpenSim.Framework.Communications
36 List<SimpleRegionInfo> RequestNeighbours(uint x, uint y); 36 List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
37 RegionInfo RequestNeighbourInfo(ulong regionHandle); 37 RegionInfo RequestNeighbourInfo(ulong regionHandle);
38 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); 38 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
39
39 } 40 }
40} \ No newline at end of file 41} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 408f37c..3a32ba9 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -105,6 +105,25 @@ namespace OpenSim.Framework.UserManagement
105 return null; 105 return null;
106 } 106 }
107 107
108 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query)
109 {
110 List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>();
111 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
112 {
113 try
114 {
115 pickerlist = plugin.Value.GeneratePickerResults(queryID, query);
116
117 }
118 catch (Exception e)
119 {
120 MainLog.Instance.Verbose("Unable to generate AgentPickerData via " + plugin.Key + "(" + query + ")");
121 return new List<AvatarPickerAvatar>();
122 }
123 }
124 return pickerlist;
125 }
126
108 127
109 /// <summary> 128 /// <summary>
110 /// Loads a user profile by name 129 /// Loads a user profile by name
diff --git a/OpenSim/Framework/Data.DB4o/DB4oGridData.cs b/OpenSim/Framework/Data.DB4o/DB4oGridData.cs
index a96d9bd..a071543 100644
--- a/OpenSim/Framework/Data.DB4o/DB4oGridData.cs
+++ b/OpenSim/Framework/Data.DB4o/DB4oGridData.cs
@@ -27,6 +27,7 @@
27*/ 27*/
28 28
29using System; 29using System;
30using System.Collections.Generic;
30using libsecondlife; 31using libsecondlife;
31 32
32namespace OpenSim.Framework.Data.DB4o 33namespace OpenSim.Framework.Data.DB4o
@@ -139,7 +140,16 @@ namespace OpenSim.Framework.Data.DB4o
139 { 140 {
140 manager = null; 141 manager = null;
141 } 142 }
143 /// <summary>
144 /// // Returns a list of avatar and UUIDs that match the query
145 /// </summary>
142 146
147 public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
148 {
149 //Do nothing yet
150 List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>();
151 return returnlist;
152 }
143 /// <summary> 153 /// <summary>
144 /// Returns the providers name 154 /// Returns the providers name
145 /// </summary> 155 /// </summary>
diff --git a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
index c7113bf..4c6d4b0 100644
--- a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
+++ b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
@@ -27,6 +27,7 @@
27*/ 27*/
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Collections.Generic;
30using libsecondlife; 31using libsecondlife;
31 32
32namespace OpenSim.Framework.Data.DB4o 33namespace OpenSim.Framework.Data.DB4o
@@ -131,7 +132,12 @@ namespace OpenSim.Framework.Data.DB4o
131 return null; 132 return null;
132 } 133 }
133 } 134 }
134 135 public List<OpenSim.Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
136 {
137 //Do nothing yet
138 List<OpenSim.Framework.AvatarPickerAvatar> returnlist = new List<OpenSim.Framework.AvatarPickerAvatar>();
139 return returnlist;
140 }
135 /// <summary> 141 /// <summary>
136 /// Creates a new user profile 142 /// Creates a new user profile
137 /// </summary> 143 /// </summary>
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
index 1946790..1516fec 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
@@ -28,10 +28,12 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Data; 30using System.Data;
31using OpenSim.Framework;
31using System.Security.Cryptography; 32using System.Security.Cryptography;
32using System.Text; 33using System.Text;
33using libsecondlife; 34using libsecondlife;
34 35
36
35namespace OpenSim.Framework.Data.MSSQL 37namespace OpenSim.Framework.Data.MSSQL
36{ 38{
37 /// <summary> 39 /// <summary>
@@ -130,7 +132,16 @@ namespace OpenSim.Framework.Data.MSSQL
130 132
131 return row; 133 return row;
132 } 134 }
135 /// <summary>
136 /// // Returns a list of avatar and UUIDs that match the query
137 /// </summary>
133 138
139 public List<OpenSim.Framework.Data.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
140 {
141 //Do nothing yet
142 List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>();
143 return returnlist;
144 }
134 /// <summary> 145 /// <summary>
135 /// Adds a new specified region to the database 146 /// Adds a new specified region to the database
136 /// </summary> 147 /// </summary>
@@ -190,5 +201,7 @@ namespace OpenSim.Framework.Data.MSSQL
190 { 201 {
191 return null; 202 return null;
192 } 203 }
204 // This is here because MSSQL GridData only seems to know about itself o.O
205
193 } 206 }
194} \ No newline at end of file 207} \ No newline at end of file
diff --git a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
index fdfc61c..930b3f4 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
@@ -169,6 +169,91 @@ namespace OpenSim.Framework.Data.MySQL
169 return null; 169 return null;
170 } 170 }
171 } 171 }
172 /// <summary>
173 /// // Returns a list of avatar and UUIDs that match the query
174 /// </summary>
175
176 public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
177 {
178 List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>();
179 string[] querysplit;
180 querysplit = query.Split(' ');
181 if (querysplit.Length == 2)
182 {
183 try
184 {
185 lock (database)
186 {
187 Dictionary<string, string> param = new Dictionary<string, string>();
188 param["?first"] = querysplit[0];
189 param["?second"] = querysplit[1];
190
191 IDbCommand result =
192 database.Query("SELECT UUID,username,surname FROM users WHERE username = ?first AND lastname = ?second", param);
193 IDataReader reader = result.ExecuteReader();
194
195
196 while (reader.Read())
197 {
198 AvatarPickerAvatar user = new AvatarPickerAvatar();
199 user.AvatarID = new LLUUID((string)reader["UUID"]);
200 user.firstName = (string)reader["username"];
201 user.lastName = (string)reader["surname"];
202 returnlist.Add(user);
203
204 }
205 reader.Close();
206 result.Dispose();
207 }
208 }
209 catch (Exception e)
210 {
211 database.Reconnect();
212 MainLog.Instance.Error(e.ToString());
213 return returnlist;
214 }
215
216
217
218 }
219 else if (querysplit.Length == 1)
220 {
221
222 try
223 {
224 lock (database)
225 {
226 Dictionary<string, string> param = new Dictionary<string, string>();
227 param["?first"] = querysplit[0];
228 param["?second"] = querysplit[1];
229
230 IDbCommand result =
231 database.Query("SELECT UUID,username,surname FROM users WHERE username = ?first OR lastname = ?second", param);
232 IDataReader reader = result.ExecuteReader();
233
234
235 while (reader.Read())
236 {
237 AvatarPickerAvatar user = new AvatarPickerAvatar();
238 user.AvatarID = new LLUUID((string)reader["UUID"]);
239 user.firstName = (string)reader["username"];
240 user.lastName = (string)reader["surname"];
241 returnlist.Add(user);
242
243 }
244 reader.Close();
245 result.Dispose();
246 }
247 }
248 catch (Exception e)
249 {
250 database.Reconnect();
251 MainLog.Instance.Error(e.ToString());
252 return returnlist;
253 }
254 }
255 return returnlist;
256 }
172 257
173 /// <summary> 258 /// <summary>
174 /// Returns a sim profile from it's UUID 259 /// Returns a sim profile from it's UUID
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
index 8846650..3ae1fba 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
@@ -97,7 +97,6 @@ namespace OpenSim.Framework.Data.MySQL
97 97
98 reader.Close(); 98 reader.Close();
99 result.Dispose(); 99 result.Dispose();
100
101 return row; 100 return row;
102 } 101 }
103 } 102 }
@@ -108,7 +107,87 @@ namespace OpenSim.Framework.Data.MySQL
108 return null; 107 return null;
109 } 108 }
110 } 109 }
110 public List<OpenSim.Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
111 {
112 List<OpenSim.Framework.AvatarPickerAvatar> returnlist = new List<OpenSim.Framework.AvatarPickerAvatar>();
113 string[] querysplit;
114 querysplit = query.Split(' ');
115 if (querysplit.Length == 2)
116 {
117 try
118 {
119 lock (database)
120 {
121 Dictionary<string, string> param = new Dictionary<string, string>();
122 param["?first"] = querysplit[0];
123 param["?second"] = querysplit[1];
124
125 IDbCommand result =
126 database.Query("SELECT UUID,username,surname FROM users WHERE username = ?first AND lastname = ?second", param);
127 IDataReader reader = result.ExecuteReader();
128
129
130 while (reader.Read())
131 {
132 OpenSim.Framework.AvatarPickerAvatar user = new OpenSim.Framework.AvatarPickerAvatar();
133 user.AvatarID = new LLUUID((string)reader["UUID"]);
134 user.firstName = (string)reader["username"];
135 user.lastName = (string)reader["surname"];
136 returnlist.Add(user);
137
138 }
139 reader.Close();
140 result.Dispose();
141 }
142 }
143 catch (Exception e)
144 {
145 database.Reconnect();
146 MainLog.Instance.Error(e.ToString());
147 return returnlist;
148 }
111 149
150
151
152 }
153 else if (querysplit.Length == 1)
154 {
155
156 try
157 {
158 lock (database)
159 {
160 Dictionary<string, string> param = new Dictionary<string, string>();
161 param["?first"] = querysplit[0];
162 param["?second"] = querysplit[1];
163
164 IDbCommand result =
165 database.Query("SELECT UUID,username,surname FROM users WHERE username = ?first OR lastname = ?second", param);
166 IDataReader reader = result.ExecuteReader();
167
168
169 while (reader.Read())
170 {
171 OpenSim.Framework.AvatarPickerAvatar user = new OpenSim.Framework.AvatarPickerAvatar();
172 user.AvatarID = new LLUUID((string)reader["UUID"]);
173 user.firstName = (string)reader["username"];
174 user.lastName = (string)reader["surname"];
175 returnlist.Add(user);
176
177 }
178 reader.Close();
179 result.Dispose();
180 }
181 }
182 catch (Exception e)
183 {
184 database.Reconnect();
185 MainLog.Instance.Error(e.ToString());
186 return returnlist;
187 }
188 }
189 return returnlist;
190 }
112 /// <summary> 191 /// <summary>
113 /// Searches the database for a specified user profile by UUID 192 /// Searches the database for a specified user profile by UUID
114 /// </summary> 193 /// </summary>
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*/
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>
diff --git a/OpenSim/Framework/Data/GridData.cs b/OpenSim/Framework/Data/GridData.cs
index b3b6ed7..23e7bf6 100644
--- a/OpenSim/Framework/Data/GridData.cs
+++ b/OpenSim/Framework/Data/GridData.cs
@@ -26,9 +26,19 @@
26* 26*
27*/ 27*/
28using libsecondlife; 28using libsecondlife;
29using System.Collections.Generic;
29 30
30namespace OpenSim.Framework.Data 31namespace OpenSim.Framework.Data
31{ 32{
33 public class AvatarPickerAvatar
34 {
35 public LLUUID AvatarID;
36 public string firstName;
37 public string lastName;
38 public AvatarPickerAvatar()
39 {
40 }
41 }
32 public enum DataResponse 42 public enum DataResponse
33 { 43 {
34 RESPONSE_OK, 44 RESPONSE_OK,
@@ -66,6 +76,8 @@ namespace OpenSim.Framework.Data
66 /// <returns>An array containing all the sim profiles in the specified range</returns> 76 /// <returns>An array containing all the sim profiles in the specified range</returns>
67 RegionProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax); 77 RegionProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
68 78
79
80 List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query);
69 /// <summary> 81 /// <summary>
70 /// Authenticates a sim by use of it's recv key. 82 /// Authenticates a sim by use of it's recv key.
71 /// WARNING: Insecure 83 /// WARNING: Insecure
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index ab5dbb6..d577a20 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -228,6 +228,7 @@ namespace OpenSim.Framework
228 public delegate void AgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset); 228 public delegate void AgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset);
229 229
230 public delegate void AgentSit(IClientAPI remoteClient, LLUUID agentID); 230 public delegate void AgentSit(IClientAPI remoteClient, LLUUID agentID);
231 public delegate void AvatarPickerRequest(IClientAPI remoteClient, LLUUID agentdata, LLUUID queryID, string UserQuery);
231 232
232 public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient); 233 public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient);
233 234
@@ -305,6 +306,7 @@ namespace OpenSim.Framework
305 event UpdateAgent OnAgentUpdate; 306 event UpdateAgent OnAgentUpdate;
306 event AgentRequestSit OnAgentRequestSit; 307 event AgentRequestSit OnAgentRequestSit;
307 event AgentSit OnAgentSit; 308 event AgentSit OnAgentSit;
309 event AvatarPickerRequest OnAvatarPickerRequest;
308 event Action<IClientAPI> OnRequestAvatarsData; 310 event Action<IClientAPI> OnRequestAvatarsData;
309 event AddNewPrim OnAddPrim; 311 event AddNewPrim OnAddPrim;
310 event ObjectDuplicate OnObjectDuplicate; 312 event ObjectDuplicate OnObjectDuplicate;
@@ -423,6 +425,7 @@ namespace OpenSim.Framework
423 void SendRemoveInventoryItem(LLUUID itemID); 425 void SendRemoveInventoryItem(LLUUID itemID);
424 void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName); 426 void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName);
425 void SendXferPacket(ulong xferID, uint packet, byte[] data); 427 void SendXferPacket(ulong xferID, uint packet, byte[] data);
428 void SendAvatarPickerReply(AvatarPickerReplyPacket Pack);
426 429
427 void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID); 430 void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID);
428 void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags); 431 void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags);
diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Framework/IUserData.cs
index cb2502a..6de9e08 100644
--- a/OpenSim/Framework/IUserData.cs
+++ b/OpenSim/Framework/IUserData.cs
@@ -26,6 +26,7 @@
26* 26*
27*/ 27*/
28using libsecondlife; 28using libsecondlife;
29using System.Collections.Generic;
29 30
30namespace OpenSim.Framework 31namespace OpenSim.Framework
31{ 32{
@@ -56,6 +57,8 @@ namespace OpenSim.Framework
56 /// <returns>The user data profile</returns> 57 /// <returns>The user data profile</returns>
57 UserProfileData GetUserByName(string fname, string lname); 58 UserProfileData GetUserByName(string fname, string lname);
58 59
60 List<OpenSim.Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query);
61
59 /// <summary> 62 /// <summary>
60 /// Returns the current agent for a user searching by it's UUID 63 /// Returns the current agent for a user searching by it's UUID
61 /// </summary> 64 /// </summary>
@@ -131,4 +134,13 @@ namespace OpenSim.Framework
131 /// </summary> 134 /// </summary>
132 void Initialise(); 135 void Initialise();
133 } 136 }
137 public class AvatarPickerAvatar
138 {
139 public LLUUID AvatarID;
140 public string firstName;
141 public string lastName;
142 public AvatarPickerAvatar()
143 {
144 }
145 }
134} \ No newline at end of file 146} \ No newline at end of file
diff --git a/OpenSim/Framework/IUserService.cs b/OpenSim/Framework/IUserService.cs
index 6465a48..de9865a 100644
--- a/OpenSim/Framework/IUserService.cs
+++ b/OpenSim/Framework/IUserService.cs
@@ -26,6 +26,7 @@
26* 26*
27*/ 27*/
28using libsecondlife; 28using libsecondlife;
29using System.Collections.Generic;
29 30
30namespace OpenSim.Framework.Interfaces 31namespace OpenSim.Framework.Interfaces
31{ 32{
@@ -35,6 +36,7 @@ namespace OpenSim.Framework.Interfaces
35 UserProfileData GetUserProfile(string name); 36 UserProfileData GetUserProfile(string name);
36 UserProfileData GetUserProfile(LLUUID userId); 37 UserProfileData GetUserProfile(LLUUID userId);
37 void clearUserAgent(LLUUID avatarID); 38 void clearUserAgent(LLUUID avatarID);
39 List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID QueryID, string Query);
38 40
39 UserProfileData SetupMasterUser(string firstName, string lastName); 41 UserProfileData SetupMasterUser(string firstName, string lastName);
40 UserProfileData SetupMasterUser(string firstName, string lastName, string password); 42 UserProfileData SetupMasterUser(string firstName, string lastName, string password);
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs
index d10aa36..9bd1ad1 100644
--- a/OpenSim/Framework/UserProfileData.cs
+++ b/OpenSim/Framework/UserProfileData.cs
@@ -146,6 +146,19 @@ namespace OpenSim.Framework
146 } 146 }
147 147
148 /// <summary> 148 /// <summary>
149 /// Minimal User Data required to service the AvatarPickerReply
150 /// </summary>
151 //public class AvatarPickerAvatar
152 //{
153 //public LLUUID AvatarID;
154 //public string firstName;
155 //public string lastName;
156 //public AvatarPickerAvatar()
157 //{
158 //}
159 //}
160
161 /// <summary>
149 /// Information about a users session 162 /// Information about a users session
150 /// </summary> 163 /// </summary>
151 public class UserAgentData 164 public class UserAgentData
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index b24b207..77c1701 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Region.ClientStack
55 public event UpdateAgent OnAgentUpdate; 55 public event UpdateAgent OnAgentUpdate;
56 public event AgentRequestSit OnAgentRequestSit; 56 public event AgentRequestSit OnAgentRequestSit;
57 public event AgentSit OnAgentSit; 57 public event AgentSit OnAgentSit;
58 public event AvatarPickerRequest OnAvatarPickerRequest;
58 public event StartAnim OnStartAnim; 59 public event StartAnim OnStartAnim;
59 public event Action<IClientAPI> OnRequestAvatarsData; 60 public event Action<IClientAPI> OnRequestAvatarsData;
60 public event LinkObjects OnLinkObjects; 61 public event LinkObjects OnLinkObjects;
@@ -705,6 +706,10 @@ namespace OpenSim.Region.ClientStack
705 sendXfer.DataPacket.Data = data; 706 sendXfer.DataPacket.Data = data;
706 OutPacket(sendXfer); 707 OutPacket(sendXfer);
707 } 708 }
709 public void SendAvatarPickerReply(AvatarPickerReplyPacket replyPacket)
710 {
711 OutPacket(replyPacket);
712 }
708 713
709 /// <summary> 714 /// <summary>
710 /// 715 ///
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 82ad1c8..1383ad9 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -217,7 +217,16 @@ namespace OpenSim.Region.ClientStack
217 OnAgentSit(this, agentSit.AgentData.AgentID); 217 OnAgentSit(this, agentSit.AgentData.AgentID);
218 } 218 }
219 break; 219 break;
220 220 case PacketType.AvatarPickerRequest:
221 AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack;
222 AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData;
223 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data;
224 //System.Console.WriteLine("Agent Sends:" + Helpers.FieldToUTF8String(querydata.Name));
225 if (OnAvatarPickerRequest != null)
226 {
227 OnAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID, Helpers.FieldToUTF8String(querydata.Name));
228 }
229 break;
221 #endregion 230 #endregion
222 231
223 #region Objects/m_sceneObjects 232 #region Objects/m_sceneObjects
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 839556d..353a24c 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -295,11 +295,16 @@ namespace OpenSim.Region.ClientStack
295 queuedLast = false; 295 queuedLast = false;
296 296
297 // TODO: May be a bit expensive doing this twice. 297 // TODO: May be a bit expensive doing this twice.
298 throttleSentPeriod += nextPacket.Packet.ToBytes().Length; 298
299 299 //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()!
300 //is a out going packet 300 if (nextPacket.Packet.Type != PacketType.AvatarPickerReply)
301 DebugPacket("OUT", nextPacket.Packet); 301 throttleSentPeriod += nextPacket.Packet.ToBytes().Length;
302 ProcessOutPacket(nextPacket.Packet); 302
303
304 //is a out going packet
305 DebugPacket("OUT", nextPacket.Packet);
306 ProcessOutPacket(nextPacket.Packet);
307
303 } 308 }
304 } 309 }
305 } 310 }
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 990998e..cd60ac2 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -28,6 +28,7 @@
28 28
29using System; 29using System;
30using System.Collections; 30using System.Collections;
31using System.Collections.Generic;
31using System.Net; 32using System.Net;
32using libsecondlife; 33using libsecondlife;
33using Nwc.XmlRpc; 34using Nwc.XmlRpc;
@@ -85,6 +86,13 @@ namespace OpenSim.Region.Communications.OGS1
85 return GetUserProfile(firstName + " " + lastName); 86 return GetUserProfile(firstName + " " + lastName);
86 } 87 }
87 88
89
90 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query)
91 {
92 List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>();
93
94 return pickerlist;
95 }
88 public UserProfileData GetUserProfile(string name) 96 public UserProfileData GetUserProfile(string name)
89 { 97 {
90 try 98 try
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 74e9a43..435022b 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -29,6 +29,7 @@ using System.Collections.Generic;
29using libsecondlife; 29using libsecondlife;
30using libsecondlife.Packets; 30using libsecondlife.Packets;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Framework.UserManagement;
32using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
33 34
34namespace OpenSim.Region.Environment.Scenes 35namespace OpenSim.Region.Environment.Scenes
@@ -155,5 +156,43 @@ namespace OpenSim.Region.Environment.Scenes
155 } 156 }
156 } 157 }
157 } 158 }
159 public void ProcessAvatarPickerRequest(IClientAPI client, LLUUID avatarID, LLUUID RequestID, string query)
160 {
161 //EventManager.TriggerAvatarPickerRequest();
162
163
164 List<AvatarPickerAvatar> AvatarResponses = new List<AvatarPickerAvatar>();
165 AvatarResponses = CommsManager.GenerateAgentPickerRequestResponse(RequestID, query);
166
167 AvatarPickerReplyPacket replyPacket = new AvatarPickerReplyPacket();
168 AvatarPickerReplyPacket.DataBlock[] searchData = new AvatarPickerReplyPacket.DataBlock[AvatarResponses.Count];
169 AvatarPickerReplyPacket.AgentDataBlock agentData = new AvatarPickerReplyPacket.AgentDataBlock();
170
171 agentData.AgentID = avatarID;
172 agentData.QueryID = RequestID;
173 replyPacket.AgentData = agentData;
174 byte[] bytes = new byte[AvatarResponses.Count * 32];
175
176 int i = 0;
177 foreach (AvatarPickerAvatar item in AvatarResponses)
178 {
179 LLUUID translatedIDtem = item.AvatarID;
180 searchData[i] = new AvatarPickerReplyPacket.DataBlock();
181 searchData[i].AvatarID = translatedIDtem;
182 searchData[i].FirstName = Helpers.StringToField((string)item.firstName);
183 searchData[i].LastName = Helpers.StringToField((string)item.lastName);
184 i++;
185
186 }
187 if (AvatarResponses.Count == 0)
188 {
189 searchData = new AvatarPickerReplyPacket.DataBlock[0];
190 }
191 replyPacket.Data = searchData;
192 client.SendAvatarPickerReply(replyPacket);
193
194
195 }
196
158 } 197 }
159} \ No newline at end of file 198} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index bf56fe8..d7e36c5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -38,10 +38,10 @@ using OpenSim.Framework;
38using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
39using OpenSim.Framework.Communications.Cache; 39using OpenSim.Framework.Communications.Cache;
40using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
41using OpenSim.Region.Environment.LandManagement;
41using OpenSim.Framework.Servers; 42using OpenSim.Framework.Servers;
42using OpenSim.Region.Capabilities; 43using OpenSim.Region.Capabilities;
43using OpenSim.Region.Environment.Interfaces; 44using OpenSim.Region.Environment.Interfaces;
44using OpenSim.Region.Environment.LandManagement;
45using OpenSim.Region.Environment.Modules; 45using OpenSim.Region.Environment.Modules;
46using OpenSim.Region.Environment.Scenes.Scripting; 46using OpenSim.Region.Environment.Scenes.Scripting;
47using OpenSim.Region.Environment.Types; 47using OpenSim.Region.Environment.Types;
@@ -732,7 +732,8 @@ namespace OpenSim.Region.Environment.Scenes
732 client.OnRemoveTaskItem += RemoveTaskInventory; 732 client.OnRemoveTaskItem += RemoveTaskInventory;
733 733
734 client.OnGrabObject += ProcessObjectGrab; 734 client.OnGrabObject += ProcessObjectGrab;
735 735 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
736
736 EventManager.TriggerOnNewClient(client); 737 EventManager.TriggerOnNewClient(client);
737 } 738 }
738 739
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index c9c24fe..3c6cad8 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -32,9 +32,11 @@ using libsecondlife;
32using libsecondlife.Packets; 32using libsecondlife.Packets;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
35using OpenSim.Framework.Communications;
35using OpenSim.Region.Environment.Types; 36using OpenSim.Region.Environment.Types;
36using OpenSim.Region.Physics.Manager; 37using OpenSim.Region.Physics.Manager;
37 38
39
38namespace OpenSim.Region.Environment.Scenes 40namespace OpenSim.Region.Environment.Scenes
39{ 41{
40 public partial class ScenePresence : EntityBase 42 public partial class ScenePresence : EntityBase
@@ -274,6 +276,7 @@ namespace OpenSim.Region.Environment.Scenes
274 m_controllingClient.OnAgentRequestSit += HandleAgentRequestSit; 276 m_controllingClient.OnAgentRequestSit += HandleAgentRequestSit;
275 m_controllingClient.OnAgentSit += HandleAgentSit; 277 m_controllingClient.OnAgentSit += HandleAgentSit;
276 m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun; 278 m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun;
279
277 // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); 280 // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
278 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); 281 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
279 //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); 282 //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
@@ -1227,5 +1230,6 @@ namespace OpenSim.Region.Environment.Scenes
1227 { 1230 {
1228 m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++); 1231 m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++);
1229 } 1232 }
1233
1230 } 1234 }
1231} 1235}
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 86bb532..61402be 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -71,6 +71,7 @@ namespace SimpleApp
71 public event UpdateAgent OnAgentUpdate; 71 public event UpdateAgent OnAgentUpdate;
72 public event AgentRequestSit OnAgentRequestSit; 72 public event AgentRequestSit OnAgentRequestSit;
73 public event AgentSit OnAgentSit; 73 public event AgentSit OnAgentSit;
74 public event AvatarPickerRequest OnAvatarPickerRequest;
74 public event Action<IClientAPI> OnRequestAvatarsData; 75 public event Action<IClientAPI> OnRequestAvatarsData;
75 public event AddNewPrim OnAddPrim; 76 public event AddNewPrim OnAddPrim;
76 public event ObjectDuplicate OnObjectDuplicate; 77 public event ObjectDuplicate OnObjectDuplicate;
@@ -179,7 +180,10 @@ namespace SimpleApp
179 public virtual void SendStartPingCheck(byte seq) 180 public virtual void SendStartPingCheck(byte seq)
180 { 181 {
181 } 182 }
183 public virtual void SendAvatarPickerReply(AvatarPickerReplyPacket response)
184 {
182 185
186 }
183 public virtual void SendKillObject(ulong regionHandle, uint localID) 187 public virtual void SendKillObject(ulong regionHandle, uint localID)
184 { 188 {
185 } 189 }