aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-14 19:59:32 +0000
committerMelanie Thielker2008-08-14 19:59:32 +0000
commit7161689a97edcdeceee3d3eeeaee7eadc4e06a89 (patch)
treea6b77bb4cb8598ce3075f8b5e58895fe0f7a0363 /OpenSim/Data/MySQL
parentMake the estate owner work. Changes permissions checks to allow the (diff)
downloadopensim-SC_OLD-7161689a97edcdeceee3d3eeeaee7eadc4e06a89.zip
opensim-SC_OLD-7161689a97edcdeceee3d3eeeaee7eadc4e06a89.tar.gz
opensim-SC_OLD-7161689a97edcdeceee3d3eeeaee7eadc4e06a89.tar.bz2
opensim-SC_OLD-7161689a97edcdeceee3d3eeeaee7eadc4e06a89.tar.xz
Adds UserFlags and GodLevel to the user data store and plumbs then in.
This will have no effect unless both the UGAI and the region are this revision or later
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs15
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs2
-rw-r--r--OpenSim/Data/MySQL/Resources/003_UserStore.sql6
3 files changed, 19 insertions, 4 deletions
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index 297b1a7..5e9e259 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -587,6 +587,9 @@ namespace OpenSim.Data.MySQL
587 LLUUID.TryParse((string)reader["webLoginKey"], out tmp); 587 LLUUID.TryParse((string)reader["webLoginKey"], out tmp);
588 retval.WebLoginKey = tmp; 588 retval.WebLoginKey = tmp;
589 } 589 }
590
591 retval.UserFlags = Convert.ToInt32(reader["userFlags"].ToString());
592 retval.GodLevel = Convert.ToInt32(reader["godLevel"].ToString());
590 593
591 } 594 }
592 else 595 else
@@ -728,14 +731,14 @@ namespace OpenSim.Data.MySQL
728 "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, "; 731 "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, ";
729 sql += 732 sql +=
730 "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, "; 733 "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, ";
731 sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`) VALUES "; 734 sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`, `userFlags`, `godLevel`) VALUES ";
732 735
733 sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, "; 736 sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, ";
734 sql += 737 sql +=
735 "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, "; 738 "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, ";
736 sql += 739 sql +=
737 "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, "; 740 "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, ";
738 sql += "?profileFirstText, ?profileImage, ?profileFirstImage, ?webLoginKey)"; 741 sql += "?profileFirstText, ?profileImage, ?profileFirstImage, ?webLoginKey, ?userFlags, ?godLevel)";
739 742
740 Dictionary<string, string> parameters = new Dictionary<string, string>(); 743 Dictionary<string, string> parameters = new Dictionary<string, string>();
741 parameters["?UUID"] = uuid.ToString(); 744 parameters["?UUID"] = uuid.ToString();
@@ -761,6 +764,9 @@ namespace OpenSim.Data.MySQL
761 parameters["?profileImage"] = profileImage.ToString(); 764 parameters["?profileImage"] = profileImage.ToString();
762 parameters["?profileFirstImage"] = firstImage.ToString(); 765 parameters["?profileFirstImage"] = firstImage.ToString();
763 parameters["?webLoginKey"] = string.Empty; 766 parameters["?webLoginKey"] = string.Empty;
767 parameters["?userFlags"] = "0";
768 parameters["?godLevel"] = "0";
769
764 770
765 bool returnval = false; 771 bool returnval = false;
766 772
@@ -815,7 +821,7 @@ namespace OpenSim.Data.MySQL
815 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 821 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
816 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 822 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
817 string aboutText, string firstText, 823 string aboutText, string firstText,
818 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey) 824 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey, int userFlags, int godLevel)
819 { 825 {
820 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname "; 826 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname ";
821 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , "; 827 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , ";
@@ -827,6 +833,7 @@ namespace OpenSim.Data.MySQL
827 sql += "`profileCanDoMask` = ?profileCanDoMask , `profileWantDoMask` = ?profileWantDoMask , "; 833 sql += "`profileCanDoMask` = ?profileCanDoMask , `profileWantDoMask` = ?profileWantDoMask , ";
828 sql += "`profileAboutText` = ?profileAboutText , `profileFirstText` = ?profileFirstText, "; 834 sql += "`profileAboutText` = ?profileAboutText , `profileFirstText` = ?profileFirstText, ";
829 sql += "`profileImage` = ?profileImage , `profileFirstImage` = ?profileFirstImage , "; 835 sql += "`profileImage` = ?profileImage , `profileFirstImage` = ?profileFirstImage , ";
836 sql += "`userFlags` = ?userFlags , `godLevel` = ?godLevel , ";
830 sql += "`webLoginKey` = ?webLoginKey WHERE UUID = ?UUID"; 837 sql += "`webLoginKey` = ?webLoginKey WHERE UUID = ?UUID";
831 838
832 Dictionary<string, string> parameters = new Dictionary<string, string>(); 839 Dictionary<string, string> parameters = new Dictionary<string, string>();
@@ -854,6 +861,8 @@ namespace OpenSim.Data.MySQL
854 parameters["?profileImage"] = profileImage.ToString(); 861 parameters["?profileImage"] = profileImage.ToString();
855 parameters["?profileFirstImage"] = firstImage.ToString(); 862 parameters["?profileFirstImage"] = firstImage.ToString();
856 parameters["?webLoginKey"] = webLoginKey.ToString(); 863 parameters["?webLoginKey"] = webLoginKey.ToString();
864 parameters["?userFlags"] = userFlags.ToString();
865 parameters["?godLevel"] = userFlags.ToString();
857 866
858 bool returnval = false; 867 bool returnval = false;
859 try 868 try
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index d7bf2a8..b7f4cbd 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); 688 user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey, user.UserFlags, user.GodLevel);
689 } 689 }
690 690
691 return true; 691 return true;
diff --git a/OpenSim/Data/MySQL/Resources/003_UserStore.sql b/OpenSim/Data/MySQL/Resources/003_UserStore.sql
new file mode 100644
index 0000000..6f890ee
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/003_UserStore.sql
@@ -0,0 +1,6 @@
1BEGIN;
2
3ALTER TABLE users add userFlags integer NOT NULL default 0;
4ALTER TABLE users add godLevel integer NOT NULL default 0;
5
6COMMIT;