aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-15 22:49:26 +0000
committerMelanie Thielker2008-08-15 22:49:26 +0000
commit04488d9d3819fd16502a095771d1513af02b7a93 (patch)
tree03e4673e0be665d07b45a456e8df2f11a0778bf2 /OpenSim/Data/MySQL
parentPantis #1957 (diff)
downloadopensim-SC-04488d9d3819fd16502a095771d1513af02b7a93.zip
opensim-SC-04488d9d3819fd16502a095771d1513af02b7a93.tar.gz
opensim-SC-04488d9d3819fd16502a095771d1513af02b7a93.tar.bz2
opensim-SC-04488d9d3819fd16502a095771d1513af02b7a93.tar.xz
Plumb in the partner and the account title fields for profile info.
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs27
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs2
-rw-r--r--OpenSim/Data/MySQL/Resources/004_UserStore.sql6
3 files changed, 30 insertions, 5 deletions
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index d2b436c..58599a8 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -590,7 +590,21 @@ namespace OpenSim.Data.MySQL
590 590
591 retval.UserFlags = Convert.ToInt32(reader["userFlags"].ToString()); 591 retval.UserFlags = Convert.ToInt32(reader["userFlags"].ToString());
592 retval.GodLevel = Convert.ToInt32(reader["godLevel"].ToString()); 592 retval.GodLevel = Convert.ToInt32(reader["godLevel"].ToString());
593 593 if (reader.IsDBNull(reader.GetOrdinal("customType")))
594 retval.CustomType = "";
595 else
596 retval.CustomType = reader["customType"].ToString();
597
598 if (reader.IsDBNull(reader.GetOrdinal("partner")))
599 {
600 retval.Partner = LLUUID.Zero;
601 }
602 else
603 {
604 LLUUID tmp;
605 LLUUID.TryParse((string)reader["partner"], out tmp);
606 retval.Partner = tmp;
607 }
594 } 608 }
595 else 609 else
596 { 610 {
@@ -731,14 +745,14 @@ namespace OpenSim.Data.MySQL
731 "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, "; 745 "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, ";
732 sql += 746 sql +=
733 "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, "; 747 "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, ";
734 sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`, `userFlags`, `godLevel`) VALUES "; 748 sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`, `userFlags`, `godLevel`, `customType`, `partner`) VALUES ";
735 749
736 sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, "; 750 sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, ";
737 sql += 751 sql +=
738 "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, "; 752 "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, ";
739 sql += 753 sql +=
740 "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, "; 754 "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, ";
741 sql += "?profileFirstText, ?profileImage, ?profileFirstImage, ?webLoginKey, ?userFlags, ?godLevel)"; 755 sql += "?profileFirstText, ?profileImage, ?profileFirstImage, ?webLoginKey, ?userFlags, ?godLevel, ?customType, ?partner)";
742 756
743 Dictionary<string, string> parameters = new Dictionary<string, string>(); 757 Dictionary<string, string> parameters = new Dictionary<string, string>();
744 parameters["?UUID"] = uuid.ToString(); 758 parameters["?UUID"] = uuid.ToString();
@@ -766,6 +780,8 @@ namespace OpenSim.Data.MySQL
766 parameters["?webLoginKey"] = string.Empty; 780 parameters["?webLoginKey"] = string.Empty;
767 parameters["?userFlags"] = "0"; 781 parameters["?userFlags"] = "0";
768 parameters["?godLevel"] = "0"; 782 parameters["?godLevel"] = "0";
783 parameters["?customType"] = "";
784 parameters["?partner"] = "";
769 785
770 786
771 bool returnval = false; 787 bool returnval = false;
@@ -821,7 +837,7 @@ namespace OpenSim.Data.MySQL
821 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 837 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
822 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 838 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
823 string aboutText, string firstText, 839 string aboutText, string firstText,
824 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey, int userFlags, int godLevel) 840 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey, int userFlags, int godLevel, string customType, LLUUID partner)
825 { 841 {
826 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname "; 842 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname ";
827 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , "; 843 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , ";
@@ -834,6 +850,7 @@ namespace OpenSim.Data.MySQL
834 sql += "`profileAboutText` = ?profileAboutText , `profileFirstText` = ?profileFirstText, "; 850 sql += "`profileAboutText` = ?profileAboutText , `profileFirstText` = ?profileFirstText, ";
835 sql += "`profileImage` = ?profileImage , `profileFirstImage` = ?profileFirstImage , "; 851 sql += "`profileImage` = ?profileImage , `profileFirstImage` = ?profileFirstImage , ";
836 sql += "`userFlags` = ?userFlags , `godLevel` = ?godLevel , "; 852 sql += "`userFlags` = ?userFlags , `godLevel` = ?godLevel , ";
853 sql += "`customType` = ?customType , `partner` = ?partner , ";
837 sql += "`webLoginKey` = ?webLoginKey WHERE UUID = ?UUID"; 854 sql += "`webLoginKey` = ?webLoginKey WHERE UUID = ?UUID";
838 855
839 Dictionary<string, string> parameters = new Dictionary<string, string>(); 856 Dictionary<string, string> parameters = new Dictionary<string, string>();
@@ -863,6 +880,8 @@ namespace OpenSim.Data.MySQL
863 parameters["?webLoginKey"] = webLoginKey.ToString(); 880 parameters["?webLoginKey"] = webLoginKey.ToString();
864 parameters["?userFlags"] = userFlags.ToString(); 881 parameters["?userFlags"] = userFlags.ToString();
865 parameters["?godLevel"] = godLevel.ToString(); 882 parameters["?godLevel"] = godLevel.ToString();
883 parameters["?customType"] = customType.ToString();
884 parameters["?partner"] = partner.ToString();
866 885
867 bool returnval = false; 886 bool returnval = false;
868 try 887 try
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index b7f4cbd..f77d947 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -685,7 +685,7 @@ namespace OpenSim.Data.MySQL
685 user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X, 685 user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X,
686 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI, 686 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI,
687 user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, 687 user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText,
688 user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey, user.UserFlags, user.GodLevel); 688 user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey, user.UserFlags, user.GodLevel, user.CustomType, user.Partner);
689 } 689 }
690 690
691 return true; 691 return true;
diff --git a/OpenSim/Data/MySQL/Resources/004_UserStore.sql b/OpenSim/Data/MySQL/Resources/004_UserStore.sql
new file mode 100644
index 0000000..03142af
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/004_UserStore.sql
@@ -0,0 +1,6 @@
1BEGIN;
2
3ALTER TABLE users add customType varchar(32) not null default '';
4ALTER TABLE users add partner char(36) not null default '00000000-0000-0000-0000-000000000000';
5
6COMMIT;