diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserProfilesData.cs | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index b35595d..c213dd1 100644 --- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs +++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs | |||
@@ -631,6 +631,8 @@ namespace OpenSim.Data.MySQL | |||
631 | { | 631 | { |
632 | if(reader.HasRows) | 632 | if(reader.HasRows) |
633 | { | 633 | { |
634 | m_log.DebugFormat("[PROFILES_DATA]" + | ||
635 | ": Getting data for {0}.", props.UserId); | ||
634 | reader.Read(); | 636 | reader.Read(); |
635 | props.WebUrl = (string)reader["profileURL"]; | 637 | props.WebUrl = (string)reader["profileURL"]; |
636 | UUID.TryParse((string)reader["profileImage"], out props.ImageId); | 638 | UUID.TryParse((string)reader["profileImage"], out props.ImageId); |
@@ -646,6 +648,9 @@ namespace OpenSim.Data.MySQL | |||
646 | } | 648 | } |
647 | else | 649 | else |
648 | { | 650 | { |
651 | m_log.DebugFormat("[PROFILES_DATA]" + | ||
652 | ": No data for {0}", props.UserId); | ||
653 | |||
649 | props.WebUrl = string.Empty; | 654 | props.WebUrl = string.Empty; |
650 | props.ImageId = UUID.Zero; | 655 | props.ImageId = UUID.Zero; |
651 | props.AboutText = string.Empty; | 656 | props.AboutText = string.Empty; |
@@ -891,7 +896,7 @@ namespace OpenSim.Data.MySQL | |||
891 | } | 896 | } |
892 | 897 | ||
893 | #region User Preferences | 898 | #region User Preferences |
894 | public bool GetUserPreferences(ref UserPreferences pref, ref string result) | 899 | public OSDArray GetUserPreferences(UUID avatarId) |
895 | { | 900 | { |
896 | string query = string.Empty; | 901 | string query = string.Empty; |
897 | 902 | ||
@@ -908,16 +913,19 @@ namespace OpenSim.Data.MySQL | |||
908 | dbcon.Open(); | 913 | dbcon.Open(); |
909 | using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) | 914 | using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) |
910 | { | 915 | { |
911 | cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString()); | 916 | cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); |
912 | 917 | ||
913 | using (MySqlDataReader reader = cmd.ExecuteReader()) | 918 | using (MySqlDataReader reader = cmd.ExecuteReader()) |
914 | { | 919 | { |
915 | if(reader.HasRows) | 920 | if(reader.HasRows) |
916 | { | 921 | { |
917 | reader.Read(); | 922 | reader.Read(); |
918 | bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail); | 923 | OSDMap record = new OSDMap(); |
919 | bool.TryParse((string)reader["visible"], out pref.Visible); | 924 | |
920 | pref.EMail = (string)reader["email"]; | 925 | record.Add("imviaemail",OSD.FromString((string)reader["imviaemail"])); |
926 | record.Add("visible",OSD.FromString((string)reader["visible"])); | ||
927 | record.Add("email",OSD.FromString((string)reader["email"])); | ||
928 | data.Add(record); | ||
921 | } | 929 | } |
922 | else | 930 | else |
923 | { | 931 | { |
@@ -930,8 +938,8 @@ namespace OpenSim.Data.MySQL | |||
930 | using (MySqlCommand put = new MySqlCommand(query, dbcon)) | 938 | using (MySqlCommand put = new MySqlCommand(query, dbcon)) |
931 | { | 939 | { |
932 | 940 | ||
933 | put.Parameters.AddWithValue("?Email", pref.EMail); | 941 | // put.Parameters.AddWithValue("?Email", pref.EMail); |
934 | put.Parameters.AddWithValue("?uuid", pref.UserId.ToString()); | 942 | // put.Parameters.AddWithValue("?uuid", pref.UserId.ToString()); |
935 | 943 | ||
936 | put.ExecuteNonQuery(); | 944 | put.ExecuteNonQuery(); |
937 | } | 945 | } |
@@ -944,17 +952,15 @@ namespace OpenSim.Data.MySQL | |||
944 | { | 952 | { |
945 | m_log.ErrorFormat("[PROFILES_DATA]" + | 953 | m_log.ErrorFormat("[PROFILES_DATA]" + |
946 | ": Get preferences exception {0}", e.Message); | 954 | ": Get preferences exception {0}", e.Message); |
947 | result = e.Message; | ||
948 | return false; | ||
949 | } | 955 | } |
950 | return true; | 956 | return data; |
951 | } | 957 | } |
952 | 958 | ||
953 | public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) | 959 | public bool UpdateUserPreferences(bool emailIm, bool visible, UUID avatarId ) |
954 | { | 960 | { |
955 | string query = string.Empty; | 961 | string query = string.Empty; |
956 | 962 | ||
957 | query += "UPDATE usersettings SET "; | 963 | query += "UPDATE userpsettings SET "; |
958 | query += "imviaemail=?ImViaEmail, "; | 964 | query += "imviaemail=?ImViaEmail, "; |
959 | query += "visible=?Visible, "; | 965 | query += "visible=?Visible, "; |
960 | query += "email=?EMail "; | 966 | query += "email=?EMail "; |
@@ -980,7 +986,6 @@ namespace OpenSim.Data.MySQL | |||
980 | { | 986 | { |
981 | m_log.ErrorFormat("[PROFILES_DATA]" + | 987 | m_log.ErrorFormat("[PROFILES_DATA]" + |
982 | ": UserPreferencesUpdate exception {0} {1}", e.Message, e.InnerException); | 988 | ": UserPreferencesUpdate exception {0} {1}", e.Message, e.InnerException); |
983 | result = e.Message; | ||
984 | return false; | 989 | return false; |
985 | } | 990 | } |
986 | return true; | 991 | return true; |