diff options
author | Adam Frisby | 2008-05-01 18:04:42 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-01 18:04:42 +0000 |
commit | 20a9bf08f51351e1e0a9de94f184ff56cd572665 (patch) | |
tree | 52da64dab26353b903c8e4befed0178fa72a188b /OpenSim/Grid/UserServer/UserManager.cs | |
parent | More config cleanup in LaunchSLClient. (diff) | |
download | opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.zip opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.gz opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.bz2 opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.xz |
* Rolled back a few changes.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/UserServer/UserManager.cs | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 0122ad0..5d0e1d6 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs | |||
@@ -41,11 +41,11 @@ namespace OpenSim.Grid.UserServer | |||
41 | public delegate void logOffUser(LLUUID AgentID); | 41 | public delegate void logOffUser(LLUUID AgentID); |
42 | 42 | ||
43 | public class UserManager : UserManagerBase | 43 | public class UserManager : UserManagerBase |
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private logOffUser handlerLogOffUser; | ||
48 | public event logOffUser OnLogOffUser; | 47 | public event logOffUser OnLogOffUser; |
48 | private logOffUser handlerLogOffUser = null; | ||
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Deletes an active agent session | 51 | /// Deletes an active agent session |
@@ -81,17 +81,17 @@ namespace OpenSim.Grid.UserServer | |||
81 | XmlRpcResponse response = new XmlRpcResponse(); | 81 | XmlRpcResponse response = new XmlRpcResponse(); |
82 | Hashtable responseData = new Hashtable(); | 82 | Hashtable responseData = new Hashtable(); |
83 | // Query Result Information | 83 | // Query Result Information |
84 | responseData["queryid"] = queryID.ToString(); | 84 | responseData["queryid"] = (string) queryID.ToString(); |
85 | responseData["avcount"] = returnUsers.Count.ToString(); | 85 | responseData["avcount"] = (string) returnUsers.Count.ToString(); |
86 | 86 | ||
87 | for (int i = 0; i < returnUsers.Count; i++) | 87 | for (int i = 0; i < returnUsers.Count; i++) |
88 | { | 88 | { |
89 | responseData["avatarid" + i] = returnUsers[i].AvatarID.ToString(); | 89 | responseData["avatarid" + i.ToString()] = returnUsers[i].AvatarID.ToString(); |
90 | responseData["firstname" + i] = returnUsers[i].firstName; | 90 | responseData["firstname" + i.ToString()] = returnUsers[i].firstName; |
91 | responseData["lastname" + i] = returnUsers[i].lastName; | 91 | responseData["lastname" + i.ToString()] = returnUsers[i].lastName; |
92 | } | 92 | } |
93 | response.Value = responseData; | 93 | response.Value = responseData; |
94 | 94 | ||
95 | return response; | 95 | return response; |
96 | } | 96 | } |
97 | 97 | ||
@@ -101,14 +101,14 @@ namespace OpenSim.Grid.UserServer | |||
101 | Hashtable responseData = new Hashtable(); | 101 | Hashtable responseData = new Hashtable(); |
102 | // Query Result Information | 102 | // Query Result Information |
103 | 103 | ||
104 | responseData["avcount"] = returnUsers.Count.ToString(); | 104 | responseData["avcount"] = (string)returnUsers.Count.ToString(); |
105 | 105 | ||
106 | for (int i = 0; i < returnUsers.Count; i++) | 106 | for (int i = 0; i < returnUsers.Count; i++) |
107 | { | 107 | { |
108 | responseData["ownerID" + i] = returnUsers[i].FriendListOwner.UUID.ToString(); | 108 | responseData["ownerID" + i.ToString()] = returnUsers[i].FriendListOwner.UUID.ToString(); |
109 | responseData["friendID" + i] = returnUsers[i].Friend.UUID.ToString(); | 109 | responseData["friendID" + i.ToString()] = returnUsers[i].Friend.UUID.ToString(); |
110 | responseData["ownerPerms" + i] = returnUsers[i].FriendListOwnerPerms.ToString(); | 110 | responseData["ownerPerms" + i.ToString()] = returnUsers[i].FriendListOwnerPerms.ToString(); |
111 | responseData["friendPerms" + i] = returnUsers[i].FriendPerms.ToString(); | 111 | responseData["friendPerms" + i.ToString()] = returnUsers[i].FriendPerms.ToString(); |
112 | } | 112 | } |
113 | response.Value = responseData; | 113 | response.Value = responseData; |
114 | 114 | ||
@@ -156,21 +156,6 @@ namespace OpenSim.Grid.UserServer | |||
156 | return response; | 156 | return response; |
157 | } | 157 | } |
158 | 158 | ||
159 | public override UserProfileData SetupMasterUser(string firstName, string lastName) | ||
160 | { | ||
161 | throw new Exception("The method or operation is not implemented."); | ||
162 | } | ||
163 | |||
164 | public override UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
165 | { | ||
166 | throw new Exception("The method or operation is not implemented."); | ||
167 | } | ||
168 | |||
169 | public override UserProfileData SetupMasterUser(LLUUID uuid) | ||
170 | { | ||
171 | throw new Exception("The method or operation is not implemented."); | ||
172 | } | ||
173 | |||
174 | #region XMLRPC User Methods | 159 | #region XMLRPC User Methods |
175 | 160 | ||
176 | public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request) | 161 | public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request) |
@@ -193,16 +178,15 @@ namespace OpenSim.Grid.UserServer | |||
193 | public XmlRpcResponse XmlRpcResponseXmlRPCAddUserFriend(XmlRpcRequest request) | 178 | public XmlRpcResponse XmlRpcResponseXmlRPCAddUserFriend(XmlRpcRequest request) |
194 | { | 179 | { |
195 | XmlRpcResponse response = new XmlRpcResponse(); | 180 | XmlRpcResponse response = new XmlRpcResponse(); |
196 | Hashtable requestData = (Hashtable) request.Params[0]; | 181 | Hashtable requestData = (Hashtable)request.Params[0]; |
197 | Hashtable responseData = new Hashtable(); | 182 | Hashtable responseData = new Hashtable(); |
198 | string returnString = "FALSE"; | 183 | string returnString = "FALSE"; |
199 | // Query Result Information | 184 | // Query Result Information |
200 | 185 | ||
201 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) | 186 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) |
202 | { | 187 | { |
203 | // UserManagerBase.AddNewuserFriend | 188 | // UserManagerBase.AddNewuserFriend |
204 | AddNewUserFriend(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"]), | 189 | AddNewUserFriend(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); |
205 | (uint) Convert.ToInt32((string) requestData["friendPerms"])); | ||
206 | returnString = "TRUE"; | 190 | returnString = "TRUE"; |
207 | } | 191 | } |
208 | responseData["returnString"] = returnString; | 192 | responseData["returnString"] = returnString; |
@@ -213,15 +197,15 @@ namespace OpenSim.Grid.UserServer | |||
213 | public XmlRpcResponse XmlRpcResponseXmlRPCRemoveUserFriend(XmlRpcRequest request) | 197 | public XmlRpcResponse XmlRpcResponseXmlRPCRemoveUserFriend(XmlRpcRequest request) |
214 | { | 198 | { |
215 | XmlRpcResponse response = new XmlRpcResponse(); | 199 | XmlRpcResponse response = new XmlRpcResponse(); |
216 | Hashtable requestData = (Hashtable) request.Params[0]; | 200 | Hashtable requestData = (Hashtable)request.Params[0]; |
217 | Hashtable responseData = new Hashtable(); | 201 | Hashtable responseData = new Hashtable(); |
218 | string returnString = "FALSE"; | 202 | string returnString = "FALSE"; |
219 | // Query Result Information | 203 | // Query Result Information |
220 | 204 | ||
221 | if (requestData.Contains("ownerID") && requestData.Contains("friendID")) | 205 | if (requestData.Contains("ownerID") && requestData.Contains("friendID")) |
222 | { | 206 | { |
223 | // UserManagerBase.AddNewuserFriend | 207 | // UserManagerBase.AddNewuserFriend |
224 | RemoveUserFriend(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"])); | 208 | RemoveUserFriend(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"])); |
225 | returnString = "TRUE"; | 209 | returnString = "TRUE"; |
226 | } | 210 | } |
227 | responseData["returnString"] = returnString; | 211 | responseData["returnString"] = returnString; |
@@ -232,14 +216,13 @@ namespace OpenSim.Grid.UserServer | |||
232 | public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request) | 216 | public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request) |
233 | { | 217 | { |
234 | XmlRpcResponse response = new XmlRpcResponse(); | 218 | XmlRpcResponse response = new XmlRpcResponse(); |
235 | Hashtable requestData = (Hashtable) request.Params[0]; | 219 | Hashtable requestData = (Hashtable)request.Params[0]; |
236 | Hashtable responseData = new Hashtable(); | 220 | Hashtable responseData = new Hashtable(); |
237 | string returnString = "FALSE"; | 221 | string returnString = "FALSE"; |
238 | 222 | ||
239 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) | 223 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) |
240 | { | 224 | { |
241 | UpdateUserFriendPerms(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"]), | 225 | UpdateUserFriendPerms(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); |
242 | (uint) Convert.ToInt32((string) requestData["friendPerms"])); | ||
243 | // UserManagerBase. | 226 | // UserManagerBase. |
244 | returnString = "TRUE"; | 227 | returnString = "TRUE"; |
245 | } | 228 | } |
@@ -251,16 +234,16 @@ namespace OpenSim.Grid.UserServer | |||
251 | public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request) | 234 | public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request) |
252 | { | 235 | { |
253 | XmlRpcResponse response = new XmlRpcResponse(); | 236 | XmlRpcResponse response = new XmlRpcResponse(); |
254 | Hashtable requestData = (Hashtable) request.Params[0]; | 237 | Hashtable requestData = (Hashtable)request.Params[0]; |
255 | Hashtable responseData = new Hashtable(); | 238 | Hashtable responseData = new Hashtable(); |
256 | 239 | ||
257 | List<FriendListItem> returndata = new List<FriendListItem>(); | 240 | List<FriendListItem> returndata = new List<FriendListItem>(); |
258 | 241 | ||
259 | if (requestData.Contains("ownerID")) | 242 | if (requestData.Contains("ownerID")) |
260 | { | 243 | { |
261 | returndata = GetUserFriendList(new LLUUID((string) requestData["ownerID"])); | 244 | returndata = this.GetUserFriendList(new LLUUID((string)requestData["ownerID"])); |
262 | } | 245 | } |
263 | 246 | ||
264 | return FriendListItemListtoXmlRPCResponse(returndata); | 247 | return FriendListItemListtoXmlRPCResponse(returndata); |
265 | } | 248 | } |
266 | 249 | ||
@@ -338,7 +321,7 @@ namespace OpenSim.Grid.UserServer | |||
338 | { | 321 | { |
339 | m_log.Debug("[UserManager]: Got request to update user profile"); | 322 | m_log.Debug("[UserManager]: Got request to update user profile"); |
340 | XmlRpcResponse response = new XmlRpcResponse(); | 323 | XmlRpcResponse response = new XmlRpcResponse(); |
341 | Hashtable requestData = (Hashtable) request.Params[0]; | 324 | Hashtable requestData = (Hashtable)request.Params[0]; |
342 | Hashtable responseData = new Hashtable(); | 325 | Hashtable responseData = new Hashtable(); |
343 | 326 | ||
344 | UserProfileData userProfile; | 327 | UserProfileData userProfile; |
@@ -347,7 +330,7 @@ namespace OpenSim.Grid.UserServer | |||
347 | return CreateUnknownUserErrorResponse(); | 330 | return CreateUnknownUserErrorResponse(); |
348 | } | 331 | } |
349 | 332 | ||
350 | LLUUID UserUUID = new LLUUID((string) requestData["avatar_uuid"]); | 333 | LLUUID UserUUID = new LLUUID((string)requestData["avatar_uuid"]); |
351 | userProfile = GetUserProfile(UserUUID); | 334 | userProfile = GetUserProfile(UserUUID); |
352 | if (null == userProfile) | 335 | if (null == userProfile) |
353 | { | 336 | { |
@@ -359,33 +342,33 @@ namespace OpenSim.Grid.UserServer | |||
359 | } | 342 | } |
360 | if (requestData.Contains("FLImageID")) | 343 | if (requestData.Contains("FLImageID")) |
361 | { | 344 | { |
362 | userProfile.FirstLifeImage = new LLUUID((string) requestData["FLImageID"]); | 345 | userProfile.FirstLifeImage = new LLUUID((string)requestData["FLImageID"]); |
363 | } | 346 | } |
364 | if (requestData.Contains("ImageID")) | 347 | if (requestData.Contains("ImageID")) |
365 | { | 348 | { |
366 | userProfile.Image = new LLUUID((string) requestData["ImageID"]); | 349 | userProfile.Image = new LLUUID((string)requestData["ImageID"]); |
367 | } | 350 | } |
368 | // dont' know how yet | 351 | // dont' know how yet |
369 | if (requestData.Contains("MaturePublish")) | 352 | if (requestData.Contains("MaturePublish")) |
370 | { | 353 | { |
371 | } | 354 | } |
372 | if (requestData.Contains("AboutText")) | 355 | if (requestData.Contains("AboutText")) |
373 | { | 356 | { |
374 | userProfile.AboutText = (string) requestData["AboutText"]; | 357 | userProfile.AboutText = (string)requestData["AboutText"]; |
375 | } | 358 | } |
376 | if (requestData.Contains("FLAboutText")) | 359 | if (requestData.Contains("FLAboutText")) |
377 | { | 360 | { |
378 | userProfile.FirstLifeAboutText = (string) requestData["FLAboutText"]; | 361 | userProfile.FirstLifeAboutText = (string)requestData["FLAboutText"]; |
379 | } | 362 | } |
380 | // not in DB yet. | 363 | // not in DB yet. |
381 | if (requestData.Contains("ProfileURL")) | 364 | if (requestData.Contains("ProfileURL")) |
382 | { | 365 | { |
383 | } | 366 | } |
384 | if (requestData.Contains("home_region")) | 367 | if (requestData.Contains("home_region")) |
385 | { | 368 | { |
386 | try | 369 | try |
387 | { | 370 | { |
388 | userProfile.HomeRegion = Convert.ToUInt64((string) requestData["home_region"]); | 371 | userProfile.HomeRegion = Convert.ToUInt64((string)requestData["home_region"]); |
389 | } | 372 | } |
390 | catch (ArgumentException) | 373 | catch (ArgumentException) |
391 | { | 374 | { |
@@ -399,23 +382,25 @@ namespace OpenSim.Grid.UserServer | |||
399 | { | 382 | { |
400 | m_log.Error("[PROFILE]:Failed to set home region, Value was too large"); | 383 | m_log.Error("[PROFILE]:Failed to set home region, Value was too large"); |
401 | } | 384 | } |
385 | |||
402 | } | 386 | } |
403 | if (requestData.Contains("home_pos_x")) | 387 | if (requestData.Contains("home_pos_x")) |
404 | { | 388 | { |
405 | try | 389 | try |
406 | { | 390 | { |
407 | userProfile.HomeLocationX = (float) Convert.ToDecimal((string) requestData["home_pos_x"]); | 391 | userProfile.HomeLocationX = (float)Convert.ToDecimal((string)requestData["home_pos_x"]); |
408 | } | 392 | } |
409 | catch (InvalidCastException) | 393 | catch (InvalidCastException) |
410 | { | 394 | { |
411 | m_log.Error("[PROFILE]:Failed to set home postion x"); | 395 | m_log.Error("[PROFILE]:Failed to set home postion x"); |
412 | } | 396 | } |
397 | |||
413 | } | 398 | } |
414 | if (requestData.Contains("home_pos_y")) | 399 | if (requestData.Contains("home_pos_y")) |
415 | { | 400 | { |
416 | try | 401 | try |
417 | { | 402 | { |
418 | userProfile.HomeLocationY = (float) Convert.ToDecimal((string) requestData["home_pos_y"]); | 403 | userProfile.HomeLocationY = (float)Convert.ToDecimal((string)requestData["home_pos_y"]); |
419 | } | 404 | } |
420 | catch (InvalidCastException) | 405 | catch (InvalidCastException) |
421 | { | 406 | { |
@@ -426,7 +411,7 @@ namespace OpenSim.Grid.UserServer | |||
426 | { | 411 | { |
427 | try | 412 | try |
428 | { | 413 | { |
429 | userProfile.HomeLocationZ = (float) Convert.ToDecimal((string) requestData["home_pos_z"]); | 414 | userProfile.HomeLocationZ = (float)Convert.ToDecimal((string)requestData["home_pos_z"]); |
430 | } | 415 | } |
431 | catch (InvalidCastException) | 416 | catch (InvalidCastException) |
432 | { | 417 | { |
@@ -437,7 +422,7 @@ namespace OpenSim.Grid.UserServer | |||
437 | { | 422 | { |
438 | try | 423 | try |
439 | { | 424 | { |
440 | userProfile.HomeLookAtX = (float) Convert.ToDecimal((string) requestData["home_look_x"]); | 425 | userProfile.HomeLookAtX = (float)Convert.ToDecimal((string)requestData["home_look_x"]); |
441 | } | 426 | } |
442 | catch (InvalidCastException) | 427 | catch (InvalidCastException) |
443 | { | 428 | { |
@@ -448,7 +433,7 @@ namespace OpenSim.Grid.UserServer | |||
448 | { | 433 | { |
449 | try | 434 | try |
450 | { | 435 | { |
451 | userProfile.HomeLookAtY = (float) Convert.ToDecimal((string) requestData["home_look_y"]); | 436 | userProfile.HomeLookAtY = (float)Convert.ToDecimal((string)requestData["home_look_y"]); |
452 | } | 437 | } |
453 | catch (InvalidCastException) | 438 | catch (InvalidCastException) |
454 | { | 439 | { |
@@ -457,9 +442,9 @@ namespace OpenSim.Grid.UserServer | |||
457 | } | 442 | } |
458 | if (requestData.Contains("home_look_z")) | 443 | if (requestData.Contains("home_look_z")) |
459 | { | 444 | { |
460 | try | 445 | try |
461 | { | 446 | { |
462 | userProfile.HomeLookAtZ = (float) Convert.ToDecimal((string) requestData["home_look_z"]); | 447 | userProfile.HomeLookAtZ = (float)Convert.ToDecimal((string)requestData["home_look_z"]); |
463 | } | 448 | } |
464 | catch (InvalidCastException) | 449 | catch (InvalidCastException) |
465 | { | 450 | { |
@@ -476,18 +461,18 @@ namespace OpenSim.Grid.UserServer | |||
476 | public XmlRpcResponse XmlRPCLogOffUserMethodUUID(XmlRpcRequest request) | 461 | public XmlRpcResponse XmlRPCLogOffUserMethodUUID(XmlRpcRequest request) |
477 | { | 462 | { |
478 | XmlRpcResponse response = new XmlRpcResponse(); | 463 | XmlRpcResponse response = new XmlRpcResponse(); |
479 | Hashtable requestData = (Hashtable) request.Params[0]; | 464 | Hashtable requestData = (Hashtable)request.Params[0]; |
480 | 465 | ||
481 | if (requestData.Contains("avatar_uuid")) | 466 | if (requestData.Contains("avatar_uuid")) |
482 | { | 467 | { |
483 | try | 468 | try |
484 | { | 469 | { |
485 | LLUUID userUUID = new LLUUID((string) requestData["avatar_uuid"]); | 470 | LLUUID userUUID = new LLUUID((string)requestData["avatar_uuid"]); |
486 | LLUUID RegionID = new LLUUID((string) requestData["region_uuid"]); | 471 | LLUUID RegionID = new LLUUID((string)requestData["region_uuid"]); |
487 | ulong regionhandle = (ulong) Convert.ToInt64((string) requestData["region_handle"]); | 472 | ulong regionhandle = (ulong)Convert.ToInt64((string)requestData["region_handle"]); |
488 | float posx = (float) Convert.ToDecimal((string) requestData["region_pos_x"]); | 473 | float posx = (float)Convert.ToDecimal((string)requestData["region_pos_x"]); |
489 | float posy = (float) Convert.ToDecimal((string) requestData["region_pos_y"]); | 474 | float posy = (float)Convert.ToDecimal((string)requestData["region_pos_y"]); |
490 | float posz = (float) Convert.ToDecimal((string) requestData["region_pos_z"]); | 475 | float posz = (float)Convert.ToDecimal((string)requestData["region_pos_z"]); |
491 | 476 | ||
492 | handlerLogOffUser = OnLogOffUser; | 477 | handlerLogOffUser = OnLogOffUser; |
493 | if (handlerLogOffUser != null) | 478 | if (handlerLogOffUser != null) |
@@ -510,5 +495,20 @@ namespace OpenSim.Grid.UserServer | |||
510 | } | 495 | } |
511 | 496 | ||
512 | #endregion | 497 | #endregion |
498 | |||
499 | public override UserProfileData SetupMasterUser(string firstName, string lastName) | ||
500 | { | ||
501 | throw new Exception("The method or operation is not implemented."); | ||
502 | } | ||
503 | |||
504 | public override UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
505 | { | ||
506 | throw new Exception("The method or operation is not implemented."); | ||
507 | } | ||
508 | |||
509 | public override UserProfileData SetupMasterUser(LLUUID uuid) | ||
510 | { | ||
511 | throw new Exception("The method or operation is not implemented."); | ||
512 | } | ||
513 | } | 513 | } |
514 | } \ No newline at end of file | 514 | } |