aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorSean Dague2008-04-10 13:53:06 +0000
committerSean Dague2008-04-10 13:53:06 +0000
commitc176caeb05c2264654b764e4d010561da60c24fc (patch)
tree87e0cab128ecaac57c5995df4cf5048185fe383f /OpenSim/Data/MySQL
parent* Brings back map tile generation based on the terrain. The algorithm produc... (diff)
downloadopensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.zip
opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.tar.gz
opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.tar.bz2
opensim-SC_OLD-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/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs63
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs28
2 files changed, 51 insertions, 40 deletions
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index 0d36136..110f192 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -427,60 +427,71 @@ namespace OpenSim.Data.MySQL
427 427
428 if (reader.Read()) 428 if (reader.Read())
429 { 429 {
430 if (!LLUUID.TryParse((string)reader["UUID"], out retval.UUID)) 430 LLUUID id;
431 if (!LLUUID.TryParse((string)reader["UUID"], out id))
431 return null; 432 return null;
432 retval.username = (string) reader["username"];
433 retval.surname = (string) reader["lastname"];
434 433
435 retval.passwordHash = (string) reader["passwordHash"]; 434 retval.Id = id;
436 retval.passwordSalt = (string) reader["passwordSalt"]; 435 retval.FirstName = (string) reader["username"];
436 retval.SurName = (string) reader["lastname"];
437
438 retval.PasswordHash = (string) reader["passwordHash"];
439 retval.PasswordSalt = (string) reader["passwordSalt"];
437 440
438 retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); 441 retval.HomeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
439 retval.homeLocation = new LLVector3( 442 retval.HomeLocation = new LLVector3(
440 Convert.ToSingle(reader["homeLocationX"].ToString()), 443 Convert.ToSingle(reader["homeLocationX"].ToString()),
441 Convert.ToSingle(reader["homeLocationY"].ToString()), 444 Convert.ToSingle(reader["homeLocationY"].ToString()),
442 Convert.ToSingle(reader["homeLocationZ"].ToString())); 445 Convert.ToSingle(reader["homeLocationZ"].ToString()));
443 retval.homeLookAt = new LLVector3( 446 retval.HomeLookAt = new LLVector3(
444 Convert.ToSingle(reader["homeLookAtX"].ToString()), 447 Convert.ToSingle(reader["homeLookAtX"].ToString()),
445 Convert.ToSingle(reader["homeLookAtY"].ToString()), 448 Convert.ToSingle(reader["homeLookAtY"].ToString()),
446 Convert.ToSingle(reader["homeLookAtZ"].ToString())); 449 Convert.ToSingle(reader["homeLookAtZ"].ToString()));
447 450
448 retval.created = Convert.ToInt32(reader["created"].ToString()); 451 retval.Created = Convert.ToInt32(reader["created"].ToString());
449 retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); 452 retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
450 453
451 retval.userInventoryURI = (string) reader["userInventoryURI"]; 454 retval.UserInventoryURI = (string) reader["userInventoryURI"];
452 retval.userAssetURI = (string) reader["userAssetURI"]; 455 retval.UserAssetURI = (string) reader["userAssetURI"];
453 456
454 retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); 457 retval.ProfileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
455 retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); 458 retval.ProfileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
456 459
457 if (reader.IsDBNull(reader.GetOrdinal("profileAboutText"))) 460 if (reader.IsDBNull(reader.GetOrdinal("profileAboutText")))
458 retval.profileAboutText = ""; 461 retval.ProfileAboutText = "";
459 else 462 else
460 retval.profileAboutText = (string) reader["profileAboutText"]; 463 retval.ProfileAboutText = (string) reader["profileAboutText"];
461 464
462 if (reader.IsDBNull(reader.GetOrdinal("profileFirstText"))) 465 if (reader.IsDBNull(reader.GetOrdinal("profileFirstText")))
463 retval.profileFirstText = ""; 466 retval.ProfileFirstText = "";
464 else 467 else
465 retval.profileFirstText = (string)reader["profileFirstText"]; 468 retval.ProfileFirstText = (string)reader["profileFirstText"];
466 469
467 if (reader.IsDBNull(reader.GetOrdinal("profileImage"))) 470 if (reader.IsDBNull(reader.GetOrdinal("profileImage")))
468 retval.profileImage = LLUUID.Zero; 471 retval.ProfileImage = LLUUID.Zero;
469 else 472 else {
470 LLUUID.TryParse((string)reader["profileImage"], out retval.profileImage); 473 LLUUID tmp;
474 LLUUID.TryParse((string)reader["profileImage"], out tmp);
475 retval.ProfileImage = tmp;
476 }
471 477
472 if (reader.IsDBNull(reader.GetOrdinal("profileFirstImage"))) 478 if (reader.IsDBNull(reader.GetOrdinal("profileFirstImage")))
473 retval.profileFirstImage = LLUUID.Zero; 479 retval.ProfileFirstImage = LLUUID.Zero;
474 else 480 else {
475 LLUUID.TryParse((string)reader["profileFirstImage"], out retval.profileFirstImage); 481 LLUUID tmp;
482 LLUUID.TryParse((string)reader["profileFirstImage"], out tmp);
483 retval.ProfileFirstImage = tmp;
484 }
476 485
477 if(reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) 486 if(reader.IsDBNull(reader.GetOrdinal("webLoginKey")))
478 { 487 {
479 retval.webLoginKey = LLUUID.Zero; 488 retval.WebLoginKey = LLUUID.Zero;
480 } 489 }
481 else 490 else
482 { 491 {
483 LLUUID.TryParse((string)reader["webLoginKey"], out retval.webLoginKey); 492 LLUUID tmp;
493 LLUUID.TryParse((string)reader["webLoginKey"], out tmp);
494 retval.WebLoginKey = tmp;
484 } 495 }
485 } 496 }
486 else 497 else
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index bd094f6..5654207 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -475,7 +475,7 @@ namespace OpenSim.Data.MySQL
475 override public UserAgentData GetAgentByName(string user, string last) 475 override public UserAgentData GetAgentByName(string user, string last)
476 { 476 {
477 UserProfileData profile = GetUserByName(user, last); 477 UserProfileData profile = GetUserByName(user, last);
478 return GetAgentByUUID(profile.UUID); 478 return GetAgentByUUID(profile.Id);
479 } 479 }
480 480
481 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) 481 override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
@@ -547,14 +547,14 @@ namespace OpenSim.Data.MySQL
547 { 547 {
548 lock (database) 548 lock (database)
549 { 549 {
550 database.insertUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, 550 database.insertUserRow(user.Id, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt,
551 user.homeRegion, user.homeLocation.X, user.homeLocation.Y, 551 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y,
552 user.homeLocation.Z, 552 user.HomeLocation.Z,
553 user.homeLookAt.X, user.homeLookAt.Y, user.homeLookAt.Z, user.created, 553 user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created,
554 user.lastLogin, user.userInventoryURI, user.userAssetURI, 554 user.LastLogin, user.UserInventoryURI, user.UserAssetURI,
555 user.profileCanDoMask, user.profileWantDoMask, 555 user.ProfileCanDoMask, user.ProfileWantDoMask,
556 user.profileAboutText, user.profileFirstText, user.profileImage, 556 user.ProfileAboutText, user.ProfileFirstText, user.ProfileImage,
557 user.profileFirstImage, user.webLoginKey); 557 user.ProfileFirstImage, user.WebLoginKey);
558 } 558 }
559 } 559 }
560 catch (Exception e) 560 catch (Exception e)
@@ -590,11 +590,11 @@ namespace OpenSim.Data.MySQL
590 /// <param name="user">The profile data to use to update the DB</param> 590 /// <param name="user">The profile data to use to update the DB</param>
591 override public bool UpdateUserProfile(UserProfileData user) 591 override public bool UpdateUserProfile(UserProfileData user)
592 { 592 {
593 database.updateUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, 593 database.updateUserRow(user.Id, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt,
594 user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z, user.homeLookAt.X, 594 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X,
595 user.homeLookAt.Y, user.homeLookAt.Z, user.created, user.lastLogin, user.userInventoryURI, 595 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI,
596 user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask, user.profileAboutText, 596 user.UserAssetURI, user.ProfileCanDoMask, user.ProfileWantDoMask, user.ProfileAboutText,
597 user.profileFirstText, user.profileImage, user.profileFirstImage, user.webLoginKey); 597 user.ProfileFirstText, user.ProfileImage, user.ProfileFirstImage, user.WebLoginKey);
598 return true; 598 return true;
599 } 599 }
600 600