aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/UserManager.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-01 16:41:01 +0000
committerAdam Frisby2008-05-01 16:41:01 +0000
commitfc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8 (patch)
tree90a4799fa43e3761ffbe669d1d87837933d8db53 /OpenSim/Grid/UserServer/UserManager.cs
parent* Deletes my EventReader ScriptRewriter. It isn't required to rewrite the sc... (diff)
downloadopensim-SC_OLD-fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8.zip
opensim-SC_OLD-fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8.tar.gz
opensim-SC_OLD-fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8.tar.bz2
opensim-SC_OLD-fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8.tar.xz
* Cleaning code still.
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/UserServer/UserManager.cs132
1 files changed, 66 insertions, 66 deletions
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
index 5d0e1d6..0122ad0 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;
47 public event logOffUser OnLogOffUser; 48 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"] = (string) queryID.ToString(); 84 responseData["queryid"] = queryID.ToString();
85 responseData["avcount"] = (string) returnUsers.Count.ToString(); 85 responseData["avcount"] = 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.ToString()] = returnUsers[i].AvatarID.ToString(); 89 responseData["avatarid" + i] = returnUsers[i].AvatarID.ToString();
90 responseData["firstname" + i.ToString()] = returnUsers[i].firstName; 90 responseData["firstname" + i] = returnUsers[i].firstName;
91 responseData["lastname" + i.ToString()] = returnUsers[i].lastName; 91 responseData["lastname" + i] = 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"] = (string)returnUsers.Count.ToString(); 104 responseData["avcount"] = 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.ToString()] = returnUsers[i].FriendListOwner.UUID.ToString(); 108 responseData["ownerID" + i] = returnUsers[i].FriendListOwner.UUID.ToString();
109 responseData["friendID" + i.ToString()] = returnUsers[i].Friend.UUID.ToString(); 109 responseData["friendID" + i] = returnUsers[i].Friend.UUID.ToString();
110 responseData["ownerPerms" + i.ToString()] = returnUsers[i].FriendListOwnerPerms.ToString(); 110 responseData["ownerPerms" + i] = returnUsers[i].FriendListOwnerPerms.ToString();
111 responseData["friendPerms" + i.ToString()] = returnUsers[i].FriendPerms.ToString(); 111 responseData["friendPerms" + i] = returnUsers[i].FriendPerms.ToString();
112 } 112 }
113 response.Value = responseData; 113 response.Value = responseData;
114 114
@@ -156,6 +156,21 @@ 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
159 #region XMLRPC User Methods 174 #region XMLRPC User Methods
160 175
161 public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request) 176 public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request)
@@ -178,15 +193,16 @@ namespace OpenSim.Grid.UserServer
178 public XmlRpcResponse XmlRpcResponseXmlRPCAddUserFriend(XmlRpcRequest request) 193 public XmlRpcResponse XmlRpcResponseXmlRPCAddUserFriend(XmlRpcRequest request)
179 { 194 {
180 XmlRpcResponse response = new XmlRpcResponse(); 195 XmlRpcResponse response = new XmlRpcResponse();
181 Hashtable requestData = (Hashtable)request.Params[0]; 196 Hashtable requestData = (Hashtable) request.Params[0];
182 Hashtable responseData = new Hashtable(); 197 Hashtable responseData = new Hashtable();
183 string returnString = "FALSE"; 198 string returnString = "FALSE";
184 // Query Result Information 199 // Query Result Information
185 200
186 if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) 201 if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms"))
187 { 202 {
188 // UserManagerBase.AddNewuserFriend 203 // UserManagerBase.AddNewuserFriend
189 AddNewUserFriend(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); 204 AddNewUserFriend(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"]),
205 (uint) Convert.ToInt32((string) requestData["friendPerms"]));
190 returnString = "TRUE"; 206 returnString = "TRUE";
191 } 207 }
192 responseData["returnString"] = returnString; 208 responseData["returnString"] = returnString;
@@ -197,15 +213,15 @@ namespace OpenSim.Grid.UserServer
197 public XmlRpcResponse XmlRpcResponseXmlRPCRemoveUserFriend(XmlRpcRequest request) 213 public XmlRpcResponse XmlRpcResponseXmlRPCRemoveUserFriend(XmlRpcRequest request)
198 { 214 {
199 XmlRpcResponse response = new XmlRpcResponse(); 215 XmlRpcResponse response = new XmlRpcResponse();
200 Hashtable requestData = (Hashtable)request.Params[0]; 216 Hashtable requestData = (Hashtable) request.Params[0];
201 Hashtable responseData = new Hashtable(); 217 Hashtable responseData = new Hashtable();
202 string returnString = "FALSE"; 218 string returnString = "FALSE";
203 // Query Result Information 219 // Query Result Information
204 220
205 if (requestData.Contains("ownerID") && requestData.Contains("friendID")) 221 if (requestData.Contains("ownerID") && requestData.Contains("friendID"))
206 { 222 {
207 // UserManagerBase.AddNewuserFriend 223 // UserManagerBase.AddNewuserFriend
208 RemoveUserFriend(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"])); 224 RemoveUserFriend(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"]));
209 returnString = "TRUE"; 225 returnString = "TRUE";
210 } 226 }
211 responseData["returnString"] = returnString; 227 responseData["returnString"] = returnString;
@@ -216,13 +232,14 @@ namespace OpenSim.Grid.UserServer
216 public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request) 232 public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request)
217 { 233 {
218 XmlRpcResponse response = new XmlRpcResponse(); 234 XmlRpcResponse response = new XmlRpcResponse();
219 Hashtable requestData = (Hashtable)request.Params[0]; 235 Hashtable requestData = (Hashtable) request.Params[0];
220 Hashtable responseData = new Hashtable(); 236 Hashtable responseData = new Hashtable();
221 string returnString = "FALSE"; 237 string returnString = "FALSE";
222 238
223 if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) 239 if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms"))
224 { 240 {
225 UpdateUserFriendPerms(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); 241 UpdateUserFriendPerms(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"]),
242 (uint) Convert.ToInt32((string) requestData["friendPerms"]));
226 // UserManagerBase. 243 // UserManagerBase.
227 returnString = "TRUE"; 244 returnString = "TRUE";
228 } 245 }
@@ -234,16 +251,16 @@ namespace OpenSim.Grid.UserServer
234 public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request) 251 public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request)
235 { 252 {
236 XmlRpcResponse response = new XmlRpcResponse(); 253 XmlRpcResponse response = new XmlRpcResponse();
237 Hashtable requestData = (Hashtable)request.Params[0]; 254 Hashtable requestData = (Hashtable) request.Params[0];
238 Hashtable responseData = new Hashtable(); 255 Hashtable responseData = new Hashtable();
239 256
240 List<FriendListItem> returndata = new List<FriendListItem>(); 257 List<FriendListItem> returndata = new List<FriendListItem>();
241 258
242 if (requestData.Contains("ownerID")) 259 if (requestData.Contains("ownerID"))
243 { 260 {
244 returndata = this.GetUserFriendList(new LLUUID((string)requestData["ownerID"])); 261 returndata = GetUserFriendList(new LLUUID((string) requestData["ownerID"]));
245 } 262 }
246 263
247 return FriendListItemListtoXmlRPCResponse(returndata); 264 return FriendListItemListtoXmlRPCResponse(returndata);
248 } 265 }
249 266
@@ -321,7 +338,7 @@ namespace OpenSim.Grid.UserServer
321 { 338 {
322 m_log.Debug("[UserManager]: Got request to update user profile"); 339 m_log.Debug("[UserManager]: Got request to update user profile");
323 XmlRpcResponse response = new XmlRpcResponse(); 340 XmlRpcResponse response = new XmlRpcResponse();
324 Hashtable requestData = (Hashtable)request.Params[0]; 341 Hashtable requestData = (Hashtable) request.Params[0];
325 Hashtable responseData = new Hashtable(); 342 Hashtable responseData = new Hashtable();
326 343
327 UserProfileData userProfile; 344 UserProfileData userProfile;
@@ -330,7 +347,7 @@ namespace OpenSim.Grid.UserServer
330 return CreateUnknownUserErrorResponse(); 347 return CreateUnknownUserErrorResponse();
331 } 348 }
332 349
333 LLUUID UserUUID = new LLUUID((string)requestData["avatar_uuid"]); 350 LLUUID UserUUID = new LLUUID((string) requestData["avatar_uuid"]);
334 userProfile = GetUserProfile(UserUUID); 351 userProfile = GetUserProfile(UserUUID);
335 if (null == userProfile) 352 if (null == userProfile)
336 { 353 {
@@ -342,33 +359,33 @@ namespace OpenSim.Grid.UserServer
342 } 359 }
343 if (requestData.Contains("FLImageID")) 360 if (requestData.Contains("FLImageID"))
344 { 361 {
345 userProfile.FirstLifeImage = new LLUUID((string)requestData["FLImageID"]); 362 userProfile.FirstLifeImage = new LLUUID((string) requestData["FLImageID"]);
346 } 363 }
347 if (requestData.Contains("ImageID")) 364 if (requestData.Contains("ImageID"))
348 { 365 {
349 userProfile.Image = new LLUUID((string)requestData["ImageID"]); 366 userProfile.Image = new LLUUID((string) requestData["ImageID"]);
350 } 367 }
351 // dont' know how yet 368 // dont' know how yet
352 if (requestData.Contains("MaturePublish")) 369 if (requestData.Contains("MaturePublish"))
353 { 370 {
354 } 371 }
355 if (requestData.Contains("AboutText")) 372 if (requestData.Contains("AboutText"))
356 { 373 {
357 userProfile.AboutText = (string)requestData["AboutText"]; 374 userProfile.AboutText = (string) requestData["AboutText"];
358 } 375 }
359 if (requestData.Contains("FLAboutText")) 376 if (requestData.Contains("FLAboutText"))
360 { 377 {
361 userProfile.FirstLifeAboutText = (string)requestData["FLAboutText"]; 378 userProfile.FirstLifeAboutText = (string) requestData["FLAboutText"];
362 } 379 }
363 // not in DB yet. 380 // not in DB yet.
364 if (requestData.Contains("ProfileURL")) 381 if (requestData.Contains("ProfileURL"))
365 { 382 {
366 } 383 }
367 if (requestData.Contains("home_region")) 384 if (requestData.Contains("home_region"))
368 { 385 {
369 try 386 try
370 { 387 {
371 userProfile.HomeRegion = Convert.ToUInt64((string)requestData["home_region"]); 388 userProfile.HomeRegion = Convert.ToUInt64((string) requestData["home_region"]);
372 } 389 }
373 catch (ArgumentException) 390 catch (ArgumentException)
374 { 391 {
@@ -382,25 +399,23 @@ namespace OpenSim.Grid.UserServer
382 { 399 {
383 m_log.Error("[PROFILE]:Failed to set home region, Value was too large"); 400 m_log.Error("[PROFILE]:Failed to set home region, Value was too large");
384 } 401 }
385
386 } 402 }
387 if (requestData.Contains("home_pos_x")) 403 if (requestData.Contains("home_pos_x"))
388 { 404 {
389 try 405 try
390 { 406 {
391 userProfile.HomeLocationX = (float)Convert.ToDecimal((string)requestData["home_pos_x"]); 407 userProfile.HomeLocationX = (float) Convert.ToDecimal((string) requestData["home_pos_x"]);
392 } 408 }
393 catch (InvalidCastException) 409 catch (InvalidCastException)
394 { 410 {
395 m_log.Error("[PROFILE]:Failed to set home postion x"); 411 m_log.Error("[PROFILE]:Failed to set home postion x");
396 } 412 }
397
398 } 413 }
399 if (requestData.Contains("home_pos_y")) 414 if (requestData.Contains("home_pos_y"))
400 { 415 {
401 try 416 try
402 { 417 {
403 userProfile.HomeLocationY = (float)Convert.ToDecimal((string)requestData["home_pos_y"]); 418 userProfile.HomeLocationY = (float) Convert.ToDecimal((string) requestData["home_pos_y"]);
404 } 419 }
405 catch (InvalidCastException) 420 catch (InvalidCastException)
406 { 421 {
@@ -411,7 +426,7 @@ namespace OpenSim.Grid.UserServer
411 { 426 {
412 try 427 try
413 { 428 {
414 userProfile.HomeLocationZ = (float)Convert.ToDecimal((string)requestData["home_pos_z"]); 429 userProfile.HomeLocationZ = (float) Convert.ToDecimal((string) requestData["home_pos_z"]);
415 } 430 }
416 catch (InvalidCastException) 431 catch (InvalidCastException)
417 { 432 {
@@ -422,7 +437,7 @@ namespace OpenSim.Grid.UserServer
422 { 437 {
423 try 438 try
424 { 439 {
425 userProfile.HomeLookAtX = (float)Convert.ToDecimal((string)requestData["home_look_x"]); 440 userProfile.HomeLookAtX = (float) Convert.ToDecimal((string) requestData["home_look_x"]);
426 } 441 }
427 catch (InvalidCastException) 442 catch (InvalidCastException)
428 { 443 {
@@ -433,7 +448,7 @@ namespace OpenSim.Grid.UserServer
433 { 448 {
434 try 449 try
435 { 450 {
436 userProfile.HomeLookAtY = (float)Convert.ToDecimal((string)requestData["home_look_y"]); 451 userProfile.HomeLookAtY = (float) Convert.ToDecimal((string) requestData["home_look_y"]);
437 } 452 }
438 catch (InvalidCastException) 453 catch (InvalidCastException)
439 { 454 {
@@ -442,9 +457,9 @@ namespace OpenSim.Grid.UserServer
442 } 457 }
443 if (requestData.Contains("home_look_z")) 458 if (requestData.Contains("home_look_z"))
444 { 459 {
445 try 460 try
446 { 461 {
447 userProfile.HomeLookAtZ = (float)Convert.ToDecimal((string)requestData["home_look_z"]); 462 userProfile.HomeLookAtZ = (float) Convert.ToDecimal((string) requestData["home_look_z"]);
448 } 463 }
449 catch (InvalidCastException) 464 catch (InvalidCastException)
450 { 465 {
@@ -461,18 +476,18 @@ namespace OpenSim.Grid.UserServer
461 public XmlRpcResponse XmlRPCLogOffUserMethodUUID(XmlRpcRequest request) 476 public XmlRpcResponse XmlRPCLogOffUserMethodUUID(XmlRpcRequest request)
462 { 477 {
463 XmlRpcResponse response = new XmlRpcResponse(); 478 XmlRpcResponse response = new XmlRpcResponse();
464 Hashtable requestData = (Hashtable)request.Params[0]; 479 Hashtable requestData = (Hashtable) request.Params[0];
465 480
466 if (requestData.Contains("avatar_uuid")) 481 if (requestData.Contains("avatar_uuid"))
467 { 482 {
468 try 483 try
469 { 484 {
470 LLUUID userUUID = new LLUUID((string)requestData["avatar_uuid"]); 485 LLUUID userUUID = new LLUUID((string) requestData["avatar_uuid"]);
471 LLUUID RegionID = new LLUUID((string)requestData["region_uuid"]); 486 LLUUID RegionID = new LLUUID((string) requestData["region_uuid"]);
472 ulong regionhandle = (ulong)Convert.ToInt64((string)requestData["region_handle"]); 487 ulong regionhandle = (ulong) Convert.ToInt64((string) requestData["region_handle"]);
473 float posx = (float)Convert.ToDecimal((string)requestData["region_pos_x"]); 488 float posx = (float) Convert.ToDecimal((string) requestData["region_pos_x"]);
474 float posy = (float)Convert.ToDecimal((string)requestData["region_pos_y"]); 489 float posy = (float) Convert.ToDecimal((string) requestData["region_pos_y"]);
475 float posz = (float)Convert.ToDecimal((string)requestData["region_pos_z"]); 490 float posz = (float) Convert.ToDecimal((string) requestData["region_pos_z"]);
476 491
477 handlerLogOffUser = OnLogOffUser; 492 handlerLogOffUser = OnLogOffUser;
478 if (handlerLogOffUser != null) 493 if (handlerLogOffUser != null)
@@ -495,20 +510,5 @@ namespace OpenSim.Grid.UserServer
495 } 510 }
496 511
497 #endregion 512 #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} 514} \ No newline at end of file