aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLManager.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-09-06 07:52:41 +0000
committerTeravus Ovares2008-09-06 07:52:41 +0000
commit7d89e122930be39e84a6d174548fa2d12ac0484a (patch)
treee5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Data/MySQL/MySQLManager.cs
parent* minor: speculatively try a change to bamboo.build to see if this generates ... (diff)
downloadopensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.zip
opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz
opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2
opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs134
1 files changed, 67 insertions, 67 deletions
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index e863216..6048f93 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -31,7 +31,7 @@ using System.Collections;
31using System.Data; 31using System.Data;
32using System.IO; 32using System.IO;
33using System.Reflection; 33using System.Reflection;
34using libsecondlife; 34using OpenMetaverse;
35using log4net; 35using log4net;
36using MySql.Data.MySqlClient; 36using MySql.Data.MySqlClient;
37using OpenSim.Framework; 37using OpenSim.Framework;
@@ -384,8 +384,8 @@ namespace OpenSim.Data.MySQL
384 { 384 {
385 retval.regionHandle = tmp64; 385 retval.regionHandle = tmp64;
386 } 386 }
387 LLUUID tmp_uuid; 387 UUID tmp_uuid;
388 if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid)) 388 if (!UUID.TryParse((string)reader["uuid"], out tmp_uuid))
389 { 389 {
390 return null; 390 return null;
391 } 391 }
@@ -396,7 +396,7 @@ namespace OpenSim.Data.MySQL
396 396
397 // non-critical parts 397 // non-critical parts
398 retval.regionName = (string)reader["regionName"]; 398 retval.regionName = (string)reader["regionName"];
399 retval.originUUID = new LLUUID((string) reader["originUUID"]); 399 retval.originUUID = new UUID((string) reader["originUUID"]);
400 400
401 // Secrets 401 // Secrets
402 retval.regionRecvKey = (string) reader["regionRecvKey"]; 402 retval.regionRecvKey = (string) reader["regionRecvKey"];
@@ -434,8 +434,8 @@ namespace OpenSim.Data.MySQL
434 retval.regionUserSendKey = (string) reader["regionUserSendKey"]; 434 retval.regionUserSendKey = (string) reader["regionUserSendKey"];
435 435
436 // World Map Addition 436 // World Map Addition
437 LLUUID.TryParse((string)reader["regionMapTexture"], out retval.regionMapTextureID); 437 UUID.TryParse((string)reader["regionMapTexture"], out retval.regionMapTextureID);
438 LLUUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid); 438 UUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid);
439 } 439 }
440 else 440 else
441 { 441 {
@@ -463,8 +463,8 @@ namespace OpenSim.Data.MySQL
463 retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString()); 463 retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString());
464 retval.reservationName = (string) reader["resName"]; 464 retval.reservationName = (string) reader["resName"];
465 retval.status = Convert.ToInt32(reader["status"].ToString()) == 1; 465 retval.status = Convert.ToInt32(reader["status"].ToString()) == 1;
466 LLUUID tmp; 466 UUID tmp;
467 LLUUID.TryParse((string) reader["userUUID"], out tmp); 467 UUID.TryParse((string) reader["userUUID"], out tmp);
468 retval.userUUID = tmp; 468 retval.userUUID = tmp;
469 } 469 }
470 else 470 else
@@ -486,15 +486,15 @@ namespace OpenSim.Data.MySQL
486 if (reader.Read()) 486 if (reader.Read())
487 { 487 {
488 // Agent IDs 488 // Agent IDs
489 LLUUID tmp; 489 UUID tmp;
490 if (!LLUUID.TryParse((string)reader["UUID"], out tmp)) 490 if (!UUID.TryParse((string)reader["UUID"], out tmp))
491 return null; 491 return null;
492 retval.ProfileID = tmp; 492 retval.ProfileID = tmp;
493 493
494 LLUUID.TryParse((string) reader["sessionID"], out tmp); 494 UUID.TryParse((string) reader["sessionID"], out tmp);
495 retval.SessionID = tmp; 495 retval.SessionID = tmp;
496 496
497 LLUUID.TryParse((string)reader["secureSessionID"], out tmp); 497 UUID.TryParse((string)reader["secureSessionID"], out tmp);
498 retval.SecureSessionID = tmp; 498 retval.SecureSessionID = tmp;
499 499
500 // Agent Who? 500 // Agent Who?
@@ -507,10 +507,10 @@ namespace OpenSim.Data.MySQL
507 retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); 507 retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString());
508 508
509 // Current position 509 // Current position
510 retval.Region = new LLUUID((string)reader["currentRegion"]); 510 retval.Region = new UUID((string)reader["currentRegion"]);
511 retval.Handle = Convert.ToUInt64(reader["currentHandle"].ToString()); 511 retval.Handle = Convert.ToUInt64(reader["currentHandle"].ToString());
512 LLVector3 tmp_v; 512 Vector3 tmp_v;
513 LLVector3.TryParse((string) reader["currentPos"], out tmp_v); 513 Vector3.TryParse((string) reader["currentPos"], out tmp_v);
514 retval.Position = tmp_v; 514 retval.Position = tmp_v;
515 } 515 }
516 else 516 else
@@ -531,8 +531,8 @@ namespace OpenSim.Data.MySQL
531 531
532 if (reader.Read()) 532 if (reader.Read())
533 { 533 {
534 LLUUID id; 534 UUID id;
535 if (!LLUUID.TryParse((string)reader["UUID"], out id)) 535 if (!UUID.TryParse((string)reader["UUID"], out id))
536 return null; 536 return null;
537 537
538 retval.ID = id; 538 retval.ID = id;
@@ -543,17 +543,17 @@ namespace OpenSim.Data.MySQL
543 retval.PasswordSalt = (string) reader["passwordSalt"]; 543 retval.PasswordSalt = (string) reader["passwordSalt"];
544 544
545 retval.HomeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); 545 retval.HomeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
546 retval.HomeLocation = new LLVector3( 546 retval.HomeLocation = new Vector3(
547 Convert.ToSingle(reader["homeLocationX"].ToString()), 547 Convert.ToSingle(reader["homeLocationX"].ToString()),
548 Convert.ToSingle(reader["homeLocationY"].ToString()), 548 Convert.ToSingle(reader["homeLocationY"].ToString()),
549 Convert.ToSingle(reader["homeLocationZ"].ToString())); 549 Convert.ToSingle(reader["homeLocationZ"].ToString()));
550 retval.HomeLookAt = new LLVector3( 550 retval.HomeLookAt = new Vector3(
551 Convert.ToSingle(reader["homeLookAtX"].ToString()), 551 Convert.ToSingle(reader["homeLookAtX"].ToString()),
552 Convert.ToSingle(reader["homeLookAtY"].ToString()), 552 Convert.ToSingle(reader["homeLookAtY"].ToString()),
553 Convert.ToSingle(reader["homeLookAtZ"].ToString())); 553 Convert.ToSingle(reader["homeLookAtZ"].ToString()));
554 554
555 LLUUID regionID = LLUUID.Zero; 555 UUID regionID = UUID.Zero;
556 LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero 556 UUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use UUID.Zero
557 retval.HomeRegionID = regionID; 557 retval.HomeRegionID = regionID;
558 558
559 retval.Created = Convert.ToInt32(reader["created"].ToString()); 559 retval.Created = Convert.ToInt32(reader["created"].ToString());
@@ -576,29 +576,29 @@ namespace OpenSim.Data.MySQL
576 retval.FirstLifeAboutText = (string)reader["profileFirstText"]; 576 retval.FirstLifeAboutText = (string)reader["profileFirstText"];
577 577
578 if (reader.IsDBNull(reader.GetOrdinal("profileImage"))) 578 if (reader.IsDBNull(reader.GetOrdinal("profileImage")))
579 retval.Image = LLUUID.Zero; 579 retval.Image = UUID.Zero;
580 else { 580 else {
581 LLUUID tmp; 581 UUID tmp;
582 LLUUID.TryParse((string)reader["profileImage"], out tmp); 582 UUID.TryParse((string)reader["profileImage"], out tmp);
583 retval.Image = tmp; 583 retval.Image = tmp;
584 } 584 }
585 585
586 if (reader.IsDBNull(reader.GetOrdinal("profileFirstImage"))) 586 if (reader.IsDBNull(reader.GetOrdinal("profileFirstImage")))
587 retval.FirstLifeImage = LLUUID.Zero; 587 retval.FirstLifeImage = UUID.Zero;
588 else { 588 else {
589 LLUUID tmp; 589 UUID tmp;
590 LLUUID.TryParse((string)reader["profileFirstImage"], out tmp); 590 UUID.TryParse((string)reader["profileFirstImage"], out tmp);
591 retval.FirstLifeImage = tmp; 591 retval.FirstLifeImage = tmp;
592 } 592 }
593 593
594 if (reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) 594 if (reader.IsDBNull(reader.GetOrdinal("webLoginKey")))
595 { 595 {
596 retval.WebLoginKey = LLUUID.Zero; 596 retval.WebLoginKey = UUID.Zero;
597 } 597 }
598 else 598 else
599 { 599 {
600 LLUUID tmp; 600 UUID tmp;
601 LLUUID.TryParse((string)reader["webLoginKey"], out tmp); 601 UUID.TryParse((string)reader["webLoginKey"], out tmp);
602 retval.WebLoginKey = tmp; 602 retval.WebLoginKey = tmp;
603 } 603 }
604 604
@@ -611,12 +611,12 @@ namespace OpenSim.Data.MySQL
611 611
612 if (reader.IsDBNull(reader.GetOrdinal("partner"))) 612 if (reader.IsDBNull(reader.GetOrdinal("partner")))
613 { 613 {
614 retval.Partner = LLUUID.Zero; 614 retval.Partner = UUID.Zero;
615 } 615 }
616 else 616 else
617 { 617 {
618 LLUUID tmp; 618 UUID tmp;
619 LLUUID.TryParse((string)reader["partner"], out tmp); 619 UUID.TryParse((string)reader["partner"], out tmp);
620 retval.Partner = tmp; 620 retval.Partner = tmp;
621 } 621 }
622 } 622 }
@@ -638,37 +638,37 @@ namespace OpenSim.Data.MySQL
638 if (reader.Read()) 638 if (reader.Read())
639 { 639 {
640 appearance = new AvatarAppearance(); 640 appearance = new AvatarAppearance();
641 appearance.Owner = new LLUUID((string)reader["owner"]); 641 appearance.Owner = new UUID((string)reader["owner"]);
642 appearance.Serial = Convert.ToInt32(reader["serial"]); 642 appearance.Serial = Convert.ToInt32(reader["serial"]);
643 appearance.VisualParams = (byte[])reader["visual_params"]; 643 appearance.VisualParams = (byte[])reader["visual_params"];
644 appearance.Texture = new LLObject.TextureEntry((byte[])reader["texture"], 0, ((byte[])reader["texture"]).Length); 644 appearance.Texture = new Primitive.TextureEntry((byte[])reader["texture"], 0, ((byte[])reader["texture"]).Length);
645 appearance.AvatarHeight = (float)Convert.ToDouble(reader["avatar_height"]); 645 appearance.AvatarHeight = (float)Convert.ToDouble(reader["avatar_height"]);
646 appearance.BodyItem = new LLUUID((string)reader["body_item"]); 646 appearance.BodyItem = new UUID((string)reader["body_item"]);
647 appearance.BodyAsset = new LLUUID((string)reader["body_asset"]); 647 appearance.BodyAsset = new UUID((string)reader["body_asset"]);
648 appearance.SkinItem = new LLUUID((string)reader["skin_item"]); 648 appearance.SkinItem = new UUID((string)reader["skin_item"]);
649 appearance.SkinAsset = new LLUUID((string)reader["skin_asset"]); 649 appearance.SkinAsset = new UUID((string)reader["skin_asset"]);
650 appearance.HairItem = new LLUUID((string)reader["hair_item"]); 650 appearance.HairItem = new UUID((string)reader["hair_item"]);
651 appearance.HairAsset = new LLUUID((string)reader["hair_asset"]); 651 appearance.HairAsset = new UUID((string)reader["hair_asset"]);
652 appearance.EyesItem = new LLUUID((string)reader["eyes_item"]); 652 appearance.EyesItem = new UUID((string)reader["eyes_item"]);
653 appearance.EyesAsset = new LLUUID((string)reader["eyes_asset"]); 653 appearance.EyesAsset = new UUID((string)reader["eyes_asset"]);
654 appearance.ShirtItem = new LLUUID((string)reader["shirt_item"]); 654 appearance.ShirtItem = new UUID((string)reader["shirt_item"]);
655 appearance.ShirtAsset = new LLUUID((string)reader["shirt_asset"]); 655 appearance.ShirtAsset = new UUID((string)reader["shirt_asset"]);
656 appearance.PantsItem = new LLUUID((string)reader["pants_item"]); 656 appearance.PantsItem = new UUID((string)reader["pants_item"]);
657 appearance.PantsAsset = new LLUUID((string)reader["pants_asset"]); 657 appearance.PantsAsset = new UUID((string)reader["pants_asset"]);
658 appearance.ShoesItem = new LLUUID((string)reader["shoes_item"]); 658 appearance.ShoesItem = new UUID((string)reader["shoes_item"]);
659 appearance.ShoesAsset = new LLUUID((string)reader["shoes_asset"]); 659 appearance.ShoesAsset = new UUID((string)reader["shoes_asset"]);
660 appearance.SocksItem = new LLUUID((string)reader["socks_item"]); 660 appearance.SocksItem = new UUID((string)reader["socks_item"]);
661 appearance.SocksAsset = new LLUUID((string)reader["socks_asset"]); 661 appearance.SocksAsset = new UUID((string)reader["socks_asset"]);
662 appearance.JacketItem = new LLUUID((string)reader["jacket_item"]); 662 appearance.JacketItem = new UUID((string)reader["jacket_item"]);
663 appearance.JacketAsset = new LLUUID((string)reader["jacket_asset"]); 663 appearance.JacketAsset = new UUID((string)reader["jacket_asset"]);
664 appearance.GlovesItem = new LLUUID((string)reader["gloves_item"]); 664 appearance.GlovesItem = new UUID((string)reader["gloves_item"]);
665 appearance.GlovesAsset = new LLUUID((string)reader["gloves_asset"]); 665 appearance.GlovesAsset = new UUID((string)reader["gloves_asset"]);
666 appearance.UnderShirtItem = new LLUUID((string)reader["undershirt_item"]); 666 appearance.UnderShirtItem = new UUID((string)reader["undershirt_item"]);
667 appearance.UnderShirtAsset = new LLUUID((string)reader["undershirt_asset"]); 667 appearance.UnderShirtAsset = new UUID((string)reader["undershirt_asset"]);
668 appearance.UnderPantsItem = new LLUUID((string)reader["underpants_item"]); 668 appearance.UnderPantsItem = new UUID((string)reader["underpants_item"]);
669 appearance.UnderPantsAsset = new LLUUID((string)reader["underpants_asset"]); 669 appearance.UnderPantsAsset = new UUID((string)reader["underpants_asset"]);
670 appearance.SkirtItem = new LLUUID((string)reader["skirt_item"]); 670 appearance.SkirtItem = new UUID((string)reader["skirt_item"]);
671 appearance.SkirtAsset = new LLUUID((string)reader["skirt_asset"]); 671 appearance.SkirtAsset = new UUID((string)reader["skirt_asset"]);
672 } 672 }
673 return appearance; 673 return appearance;
674 } 674 }
@@ -766,12 +766,12 @@ namespace OpenSim.Data.MySQL
766 /// <param name="firstImage">UUID for firstlife image</param> 766 /// <param name="firstImage">UUID for firstlife image</param>
767 /// <param name="webLoginKey">Ignored</param> 767 /// <param name="webLoginKey">Ignored</param>
768 /// <returns>Success?</returns> 768 /// <returns>Success?</returns>
769 public bool insertUserRow(LLUUID uuid, string username, string lastname, string passwordHash, 769 public bool insertUserRow(UUID uuid, string username, string lastname, string passwordHash,
770 string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, 770 string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ,
771 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 771 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
772 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 772 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
773 string aboutText, string firstText, 773 string aboutText, string firstText,
774 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey) 774 UUID profileImage, UUID firstImage, UUID webLoginKey)
775 { 775 {
776 m_log.Debug("[MySQLManager]: Fetching profile for " + uuid.ToString()); 776 m_log.Debug("[MySQLManager]: Fetching profile for " + uuid.ToString());
777 string sql = 777 string sql =
@@ -867,12 +867,12 @@ namespace OpenSim.Data.MySQL
867 /// <param name="firstImage">UUID for firstlife image</param> 867 /// <param name="firstImage">UUID for firstlife image</param>
868 /// <param name="webLoginKey">UUID for weblogin Key</param> 868 /// <param name="webLoginKey">UUID for weblogin Key</param>
869 /// <returns>Success?</returns> 869 /// <returns>Success?</returns>
870 public bool updateUserRow(LLUUID uuid, string username, string lastname, string passwordHash, 870 public bool updateUserRow(UUID uuid, string username, string lastname, string passwordHash,
871 string passwordSalt, UInt64 homeRegion, LLUUID homeRegionID, float homeLocX, float homeLocY, float homeLocZ, 871 string passwordSalt, UInt64 homeRegion, UUID homeRegionID, float homeLocX, float homeLocY, float homeLocZ,
872 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 872 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
873 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 873 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
874 string aboutText, string firstText, 874 string aboutText, string firstText,
875 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey, int userFlags, int godLevel, string customType, LLUUID partner) 875 UUID profileImage, UUID firstImage, UUID webLoginKey, int userFlags, int godLevel, string customType, UUID partner)
876 { 876 {
877 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname "; 877 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname ";
878 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , "; 878 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , ";
@@ -1211,7 +1211,7 @@ namespace OpenSim.Data.MySQL
1211 1211
1212 } 1212 }
1213 1213
1214 public void writeAttachments(LLUUID agentID, Hashtable data) 1214 public void writeAttachments(UUID agentID, Hashtable data)
1215 { 1215 {
1216 string sql = "delete from avatarattachments where UUID = ?uuid"; 1216 string sql = "delete from avatarattachments where UUID = ?uuid";
1217 1217