diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLManager.cs | 27 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/004_UserStore.sql | 6 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/Resources/004_UserStore.sql | 6 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUserData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/UserProfileData.cs | 14 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/UserManager.cs | 29 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs | 15 |
9 files changed, 110 insertions, 9 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 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE users add customType varchar(32) not null default ''; | ||
4 | ALTER TABLE users add partner char(36) not null default '00000000-0000-0000-0000-000000000000'; | ||
5 | |||
6 | COMMIT; | ||
diff --git a/OpenSim/Data/SQLite/Resources/004_UserStore.sql b/OpenSim/Data/SQLite/Resources/004_UserStore.sql new file mode 100644 index 0000000..03142af --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/004_UserStore.sql | |||
@@ -0,0 +1,6 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE users add customType varchar(32) not null default ''; | ||
4 | ALTER TABLE users add partner char(36) not null default '00000000-0000-0000-0000-000000000000'; | ||
5 | |||
6 | COMMIT; | ||
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index c55eee8..910d313 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs | |||
@@ -683,6 +683,8 @@ namespace OpenSim.Data.SQLite | |||
683 | SQLiteUtil.createCol(users, "webLoginKey", typeof(String)); | 683 | SQLiteUtil.createCol(users, "webLoginKey", typeof(String)); |
684 | SQLiteUtil.createCol(users, "userFlags", typeof (Int32)); | 684 | SQLiteUtil.createCol(users, "userFlags", typeof (Int32)); |
685 | SQLiteUtil.createCol(users, "godLevel", typeof (Int32)); | 685 | SQLiteUtil.createCol(users, "godLevel", typeof (Int32)); |
686 | SQLiteUtil.createCol(users, "customType", typeof (String)); | ||
687 | SQLiteUtil.createCol(users, "partner", typeof (String)); | ||
686 | // Add in contraints | 688 | // Add in contraints |
687 | users.PrimaryKey = new DataColumn[] {users.Columns["UUID"]}; | 689 | users.PrimaryKey = new DataColumn[] {users.Columns["UUID"]}; |
688 | return users; | 690 | return users; |
@@ -793,6 +795,8 @@ namespace OpenSim.Data.SQLite | |||
793 | user.WebLoginKey = new LLUUID((String) row["webLoginKey"]); | 795 | user.WebLoginKey = new LLUUID((String) row["webLoginKey"]); |
794 | user.UserFlags = Convert.ToInt32(row["userFlags"]); | 796 | user.UserFlags = Convert.ToInt32(row["userFlags"]); |
795 | user.GodLevel = Convert.ToInt32(row["godLevel"]); | 797 | user.GodLevel = Convert.ToInt32(row["godLevel"]); |
798 | user.CustomType = row["customType"].ToString(); | ||
799 | user.Partner = new LLUUID((String) row["partner"]); | ||
796 | 800 | ||
797 | return user; | 801 | return user; |
798 | } | 802 | } |
@@ -835,6 +839,8 @@ namespace OpenSim.Data.SQLite | |||
835 | row["webLoginKey"] = user.WebLoginKey; | 839 | row["webLoginKey"] = user.WebLoginKey; |
836 | row["userFlags"] = user.UserFlags; | 840 | row["userFlags"] = user.UserFlags; |
837 | row["godLevel"] = user.GodLevel; | 841 | row["godLevel"] = user.GodLevel; |
842 | row["customType"] = user.CustomType; | ||
843 | row["partner"] = user.Partner.ToString(); | ||
838 | 844 | ||
839 | // ADO.NET doesn't handle NULL very well | 845 | // ADO.NET doesn't handle NULL very well |
840 | foreach (DataColumn col in ds.Tables["users"].Columns) | 846 | foreach (DataColumn col in ds.Tables["users"].Columns) |
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index ec9c473..d0b4c25 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs | |||
@@ -141,6 +141,8 @@ namespace OpenSim.Framework | |||
141 | // | 141 | // |
142 | private int _userFlags; | 142 | private int _userFlags; |
143 | private int _godLevel; | 143 | private int _godLevel; |
144 | private string _customType; | ||
145 | private LLUUID _partner; | ||
144 | 146 | ||
145 | /// <summary> | 147 | /// <summary> |
146 | /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into | 148 | /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into |
@@ -348,5 +350,17 @@ namespace OpenSim.Framework | |||
348 | get { return _godLevel; } | 350 | get { return _godLevel; } |
349 | set { _godLevel = value; } | 351 | set { _godLevel = value; } |
350 | } | 352 | } |
353 | |||
354 | public virtual string CustomType | ||
355 | { | ||
356 | get { return _customType; } | ||
357 | set { _customType = value; } | ||
358 | } | ||
359 | |||
360 | public virtual LLUUID Partner | ||
361 | { | ||
362 | get { return _partner; } | ||
363 | set { _partner = value; } | ||
364 | } | ||
351 | } | 365 | } |
352 | } | 366 | } |
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 5506631..b1d95da 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs | |||
@@ -159,6 +159,8 @@ namespace OpenSim.Grid.UserServer | |||
159 | 159 | ||
160 | responseData["user_flags"] = profile.UserFlags.ToString(); | 160 | responseData["user_flags"] = profile.UserFlags.ToString(); |
161 | responseData["god_level"] = profile.GodLevel.ToString(); | 161 | responseData["god_level"] = profile.GodLevel.ToString(); |
162 | responseData["custom_type"] = profile.CustomType.ToString(); | ||
163 | responseData["partner"] = profile.Partner.ToString(); | ||
162 | response.Value = responseData; | 164 | response.Value = responseData; |
163 | 165 | ||
164 | return response; | 166 | return response; |
@@ -663,6 +665,33 @@ namespace OpenSim.Grid.UserServer | |||
663 | m_log.Error("[PROFILE]:Failed to set god level"); | 665 | m_log.Error("[PROFILE]:Failed to set god level"); |
664 | } | 666 | } |
665 | } | 667 | } |
668 | if (requestData.Contains("custom_type")) | ||
669 | { | ||
670 | try | ||
671 | { | ||
672 | userProfile.CustomType = (string)requestData["custom_type"]; | ||
673 | } | ||
674 | catch (InvalidCastException) | ||
675 | { | ||
676 | m_log.Error("[PROFILE]:Failed to set custom type"); | ||
677 | } | ||
678 | } | ||
679 | if (requestData.Contains("partner")) | ||
680 | { | ||
681 | try | ||
682 | { | ||
683 | userProfile.Partner = new LLUUID((string)requestData["partner"]); | ||
684 | } | ||
685 | catch (InvalidCastException) | ||
686 | { | ||
687 | m_log.Error("[PROFILE]:Failed to set partner"); | ||
688 | } | ||
689 | } | ||
690 | else | ||
691 | { | ||
692 | userProfile.Partner = LLUUID.Zero; | ||
693 | } | ||
694 | |||
666 | // call plugin! | 695 | // call plugin! |
667 | bool ret = UpdateUserProfileProperties(userProfile); | 696 | bool ret = UpdateUserProfileProperties(userProfile); |
668 | responseData["returnString"] = ret.ToString(); | 697 | responseData["returnString"] = ret.ToString(); |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 01b1933..3d42dfd 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | |||
@@ -92,6 +92,18 @@ namespace OpenSim.Region.Communications.OGS1 | |||
92 | if (data.Contains("god_level")) | 92 | if (data.Contains("god_level")) |
93 | userData.GodLevel = Convert.ToInt32((string) data["god_level"]); | 93 | userData.GodLevel = Convert.ToInt32((string) data["god_level"]); |
94 | 94 | ||
95 | if (data.Contains("custom_type")) | ||
96 | userData.CustomType = (string) data["custom_type"]; | ||
97 | else | ||
98 | userData.CustomType = ""; | ||
99 | if(userData.CustomType == null) | ||
100 | userData.CustomType = ""; | ||
101 | |||
102 | if (data.Contains("partner")) | ||
103 | userData.Partner = new LLUUID((string) data["partner"]); | ||
104 | else | ||
105 | userData.Partner = LLUUID.Zero; | ||
106 | |||
95 | return userData; | 107 | return userData; |
96 | } | 108 | } |
97 | 109 | ||
@@ -471,6 +483,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
471 | param["home_look_z"] = UserProfile.HomeLookAtZ.ToString(); | 483 | param["home_look_z"] = UserProfile.HomeLookAtZ.ToString(); |
472 | param["user_flags"] = UserProfile.UserFlags.ToString(); | 484 | param["user_flags"] = UserProfile.UserFlags.ToString(); |
473 | param["god_level"] = UserProfile.GodLevel.ToString(); | 485 | param["god_level"] = UserProfile.GodLevel.ToString(); |
486 | param["custom_type"] = UserProfile.CustomType.ToString(); | ||
487 | param["partner"] = UserProfile.Partner.ToString(); | ||
474 | 488 | ||
475 | IList parameters = new ArrayList(); | 489 | IList parameters = new ArrayList(); |
476 | parameters.Add(param); | 490 | parameters.Add(param); |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs index 881889f..1d1d503 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs | |||
@@ -93,17 +93,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles | |||
93 | public void RequestAvatarProperty(IClientAPI remoteClient, LLUUID avatarID) | 93 | public void RequestAvatarProperty(IClientAPI remoteClient, LLUUID avatarID) |
94 | { | 94 | { |
95 | // FIXME: finish adding fields such as url, masking, etc. | 95 | // FIXME: finish adding fields such as url, masking, etc. |
96 | LLUUID partner = new LLUUID("11111111-1111-0000-0000-000100bba000"); | ||
97 | UserProfileData profile = m_scene.CommsManager.UserService.GetUserProfile(avatarID); | 96 | UserProfileData profile = m_scene.CommsManager.UserService.GetUserProfile(avatarID); |
98 | if (null != profile) | 97 | if (null != profile) |
99 | { | 98 | { |
100 | Byte[] charterMember = new Byte[1]; | 99 | Byte[] charterMember; |
101 | charterMember[0] = (Byte)((profile.UserFlags & 0xf00) >> 8); | 100 | if(profile.CustomType == "") |
101 | { | ||
102 | charterMember = new Byte[1]; | ||
103 | charterMember[0] = (Byte)((profile.UserFlags & 0xf00) >> 8); | ||
104 | } | ||
105 | else | ||
106 | { | ||
107 | charterMember = Helpers.StringToField(profile.CustomType); | ||
108 | } | ||
102 | 109 | ||
103 | remoteClient.SendAvatarProperties(profile.ID, profile.AboutText, | 110 | remoteClient.SendAvatarProperties(profile.ID, profile.AboutText, |
104 | Util.ToDateTime(profile.Created).ToString(), | 111 | Util.ToDateTime(profile.Created).ToString(), |
105 | charterMember, profile.FirstLifeAboutText, (uint)(profile.UserFlags & 0xff), | 112 | charterMember, profile.FirstLifeAboutText, (uint)(profile.UserFlags & 0xff), |
106 | profile.FirstLifeImage, profile.Image, String.Empty, partner); | 113 | profile.FirstLifeImage, profile.Image, String.Empty, profile.Partner); |
107 | } | 114 | } |
108 | else | 115 | else |
109 | { | 116 | { |