diff options
author | Sean Dague | 2008-04-10 13:53:06 +0000 |
---|---|---|
committer | Sean Dague | 2008-04-10 13:53:06 +0000 |
commit | c176caeb05c2264654b764e4d010561da60c24fc (patch) | |
tree | 87e0cab128ecaac57c5995df4cf5048185fe383f /OpenSim/Framework/Communications/UserManagerBase.cs | |
parent | * Brings back map tile generation based on the terrain. The algorithm produc... (diff) | |
download | opensim-SC-c176caeb05c2264654b764e4d010561da60c24fc.zip opensim-SC-c176caeb05c2264654b764e4d010561da60c24fc.tar.gz opensim-SC-c176caeb05c2264654b764e4d010561da60c24fc.tar.bz2 opensim-SC-c176caeb05c2264654b764e4d010561da60c24fc.tar.xz |
moved fields to properties for UserDataProfile, which was
actually a little more work than I expected given the copious
use of out params.
Diffstat (limited to 'OpenSim/Framework/Communications/UserManagerBase.cs')
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 332583c..02be6bd 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.UserManagement | |||
96 | 96 | ||
97 | if (profile != null) | 97 | if (profile != null) |
98 | { | 98 | { |
99 | profile.currentAgent = getUserAgent(profile.UUID); | 99 | profile.CurrentAgent = getUserAgent(profile.Id); |
100 | return profile; | 100 | return profile; |
101 | } | 101 | } |
102 | } | 102 | } |
@@ -113,7 +113,7 @@ namespace OpenSim.Framework.UserManagement | |||
113 | 113 | ||
114 | if (null != profile) | 114 | if (null != profile) |
115 | { | 115 | { |
116 | profile.currentAgent = getUserAgent(profile.UUID); | 116 | profile.CurrentAgent = getUserAgent(profile.Id); |
117 | return profile; | 117 | return profile; |
118 | } | 118 | } |
119 | } | 119 | } |
@@ -298,7 +298,7 @@ namespace OpenSim.Framework.UserManagement | |||
298 | public void clearUserAgent(LLUUID agentID) | 298 | public void clearUserAgent(LLUUID agentID) |
299 | { | 299 | { |
300 | UserProfileData profile = GetUserProfile(agentID); | 300 | UserProfileData profile = GetUserProfile(agentID); |
301 | profile.currentAgent = null; | 301 | profile.CurrentAgent = null; |
302 | 302 | ||
303 | setUserProfile(profile); | 303 | setUserProfile(profile); |
304 | } | 304 | } |
@@ -355,28 +355,28 @@ namespace OpenSim.Framework.UserManagement | |||
355 | agent.sessionID = new LLUUID(randDataS, 0); | 355 | agent.sessionID = new LLUUID(randDataS, 0); |
356 | 356 | ||
357 | // Profile UUID | 357 | // Profile UUID |
358 | agent.UUID = profile.UUID; | 358 | agent.UUID = profile.Id; |
359 | 359 | ||
360 | // Current position (from Home) | 360 | // Current position (from Home) |
361 | agent.currentHandle = profile.homeRegion; | 361 | agent.currentHandle = profile.HomeRegion; |
362 | agent.currentPos = profile.homeLocation; | 362 | agent.currentPos = profile.HomeLocation; |
363 | 363 | ||
364 | // If user specified additional start, use that | 364 | // If user specified additional start, use that |
365 | if (requestData.ContainsKey("start")) | 365 | if (requestData.ContainsKey("start")) |
366 | { | 366 | { |
367 | string startLoc = ((string)requestData["start"]).Trim(); | 367 | string startLoc = ((string)requestData["start"]).Trim(); |
368 | if (("last" == startLoc) && (profile.currentAgent != null)) | 368 | if (("last" == startLoc) && (profile.CurrentAgent != null)) |
369 | { | 369 | { |
370 | if ((profile.currentAgent.currentPos.X > 0) | 370 | if ((profile.CurrentAgent.currentPos.X > 0) |
371 | && (profile.currentAgent.currentPos.Y > 0) | 371 | && (profile.CurrentAgent.currentPos.Y > 0) |
372 | && (profile.currentAgent.currentPos.Z > 0) | 372 | && (profile.CurrentAgent.currentPos.Z > 0) |
373 | ) | 373 | ) |
374 | { | 374 | { |
375 | // TODO: Right now, currentRegion has not been used in GridServer for requesting region. | 375 | // TODO: Right now, currentRegion has not been used in GridServer for requesting region. |
376 | // TODO: It is only using currentHandle. | 376 | // TODO: It is only using currentHandle. |
377 | agent.currentRegion = profile.currentAgent.currentRegion; | 377 | agent.currentRegion = profile.CurrentAgent.currentRegion; |
378 | agent.currentHandle = profile.currentAgent.currentHandle; | 378 | agent.currentHandle = profile.CurrentAgent.currentHandle; |
379 | agent.currentPos = profile.currentAgent.currentPos; | 379 | agent.currentPos = profile.CurrentAgent.currentPos; |
380 | } | 380 | } |
381 | } | 381 | } |
382 | 382 | ||
@@ -406,7 +406,7 @@ namespace OpenSim.Framework.UserManagement | |||
406 | agent.regionID = LLUUID.Zero; // Fill in later | 406 | agent.regionID = LLUUID.Zero; // Fill in later |
407 | agent.currentRegion = LLUUID.Zero; // Fill in later | 407 | agent.currentRegion = LLUUID.Zero; // Fill in later |
408 | 408 | ||
409 | profile.currentAgent = agent; | 409 | profile.CurrentAgent = agent; |
410 | } | 410 | } |
411 | 411 | ||
412 | /// <summary> | 412 | /// <summary> |
@@ -432,9 +432,9 @@ namespace OpenSim.Framework.UserManagement | |||
432 | if (userProfile != null) | 432 | if (userProfile != null) |
433 | { | 433 | { |
434 | // This line needs to be in side the above if statement or the UserServer will crash on some logouts. | 434 | // This line needs to be in side the above if statement or the UserServer will crash on some logouts. |
435 | m_log.Info("[LOGOUT]: " + userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")"); | 435 | m_log.Info("[LOGOUT]: " + userProfile.FirstName + " " + userProfile.SurName + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")"); |
436 | 436 | ||
437 | userAgent = userProfile.currentAgent; | 437 | userAgent = userProfile.CurrentAgent; |
438 | if (userAgent != null) | 438 | if (userAgent != null) |
439 | { | 439 | { |
440 | userAgent.agentOnline = false; | 440 | userAgent.agentOnline = false; |
@@ -447,7 +447,7 @@ namespace OpenSim.Framework.UserManagement | |||
447 | 447 | ||
448 | userAgent.currentHandle = regionhandle; | 448 | userAgent.currentHandle = regionhandle; |
449 | userAgent.currentPos = currentPos; | 449 | userAgent.currentPos = currentPos; |
450 | userProfile.currentAgent = userAgent; | 450 | userProfile.CurrentAgent = userAgent; |
451 | 451 | ||
452 | CommitAgent(ref userProfile); | 452 | CommitAgent(ref userProfile); |
453 | } | 453 | } |
@@ -481,11 +481,11 @@ namespace OpenSim.Framework.UserManagement | |||
481 | agent.sessionID = new LLUUID(randDataS, 0); | 481 | agent.sessionID = new LLUUID(randDataS, 0); |
482 | 482 | ||
483 | // Profile UUID | 483 | // Profile UUID |
484 | agent.UUID = profile.UUID; | 484 | agent.UUID = profile.Id; |
485 | 485 | ||
486 | // Current position (from Home) | 486 | // Current position (from Home) |
487 | agent.currentHandle = profile.homeRegion; | 487 | agent.currentHandle = profile.HomeRegion; |
488 | agent.currentPos = profile.homeLocation; | 488 | agent.currentPos = profile.HomeLocation; |
489 | 489 | ||
490 | // What time did the user login? | 490 | // What time did the user login? |
491 | agent.loginTime = Util.UnixTimeSinceEpoch(); | 491 | agent.loginTime = Util.UnixTimeSinceEpoch(); |
@@ -495,7 +495,7 @@ namespace OpenSim.Framework.UserManagement | |||
495 | agent.regionID = LLUUID.Zero; // Fill in later | 495 | agent.regionID = LLUUID.Zero; // Fill in later |
496 | agent.currentRegion = LLUUID.Zero; // Fill in later | 496 | agent.currentRegion = LLUUID.Zero; // Fill in later |
497 | 497 | ||
498 | profile.currentAgent = agent; | 498 | profile.CurrentAgent = agent; |
499 | } | 499 | } |
500 | 500 | ||
501 | /// <summary> | 501 | /// <summary> |
@@ -508,7 +508,7 @@ namespace OpenSim.Framework.UserManagement | |||
508 | // TODO: how is this function different from setUserProfile? -> Add AddUserAgent() here and commit both tables "users" and "agents" | 508 | // TODO: how is this function different from setUserProfile? -> Add AddUserAgent() here and commit both tables "users" and "agents" |
509 | // TODO: what is the logic should be? | 509 | // TODO: what is the logic should be? |
510 | bool ret = false; | 510 | bool ret = false; |
511 | ret = AddUserAgent(profile.currentAgent); | 511 | ret = AddUserAgent(profile.CurrentAgent); |
512 | ret = ret & setUserProfile(profile); | 512 | ret = ret & setUserProfile(profile); |
513 | return ret; | 513 | return ret; |
514 | } | 514 | } |
@@ -522,16 +522,16 @@ namespace OpenSim.Framework.UserManagement | |||
522 | public LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) | 522 | public LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) |
523 | { | 523 | { |
524 | UserProfileData user = new UserProfileData(); | 524 | UserProfileData user = new UserProfileData(); |
525 | user.homeLocation = new LLVector3(128, 128, 100); | 525 | user.HomeLocation = new LLVector3(128, 128, 100); |
526 | user.UUID = LLUUID.Random(); | 526 | user.Id = LLUUID.Random(); |
527 | user.username = firstName; | 527 | user.FirstName = firstName; |
528 | user.surname = lastName; | 528 | user.SurName = lastName; |
529 | user.passwordHash = pass; | 529 | user.PasswordHash = pass; |
530 | user.passwordSalt = String.Empty; | 530 | user.PasswordSalt = String.Empty; |
531 | user.created = Util.UnixTimeSinceEpoch(); | 531 | user.Created = Util.UnixTimeSinceEpoch(); |
532 | user.homeLookAt = new LLVector3(100, 100, 100); | 532 | user.HomeLookAt = new LLVector3(100, 100, 100); |
533 | user.homeRegionX = regX; | 533 | user.HomeRegionX = regX; |
534 | user.homeRegionY = regY; | 534 | user.HomeRegionY = regY; |
535 | 535 | ||
536 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 536 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
537 | { | 537 | { |
@@ -545,14 +545,14 @@ namespace OpenSim.Framework.UserManagement | |||
545 | } | 545 | } |
546 | } | 546 | } |
547 | 547 | ||
548 | return user.UUID; | 548 | return user.Id; |
549 | } | 549 | } |
550 | 550 | ||
551 | public bool UpdateUserProfileProperties(UserProfileData UserProfile) | 551 | public bool UpdateUserProfileProperties(UserProfileData UserProfile) |
552 | { | 552 | { |
553 | if (null == GetUserProfile(UserProfile.UUID)) | 553 | if (null == GetUserProfile(UserProfile.Id)) |
554 | { | 554 | { |
555 | m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.UUID.ToString()); | 555 | m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.Id.ToString()); |
556 | return false; | 556 | return false; |
557 | } | 557 | } |
558 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 558 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
@@ -563,7 +563,7 @@ namespace OpenSim.Framework.UserManagement | |||
563 | } | 563 | } |
564 | catch (Exception e) | 564 | catch (Exception e) |
565 | { | 565 | { |
566 | m_log.Info("[USERSTORAGE]: Unable to update user " + UserProfile.UUID.ToString() | 566 | m_log.Info("[USERSTORAGE]: Unable to update user " + UserProfile.Id.ToString() |
567 | + " via " + plugin.Key + "(" + e.ToString() + ")"); | 567 | + " via " + plugin.Key + "(" + e.ToString() + ")"); |
568 | return false; | 568 | return false; |
569 | } | 569 | } |