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/Data/MySQL/MySQLManager.cs | |
parent | * Brings back map tile generation based on the terrain. The algorithm produc... (diff) | |
download | opensim-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/MySQLManager.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLManager.cs | 63 |
1 files changed, 37 insertions, 26 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 |