diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserProfilesData.cs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index b35595d..295e131 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; |
@@ -894,13 +899,13 @@ namespace OpenSim.Data.MySQL | |||
894 | public bool GetUserPreferences(ref UserPreferences pref, ref string result) | 899 | public bool GetUserPreferences(ref UserPreferences pref, ref string result) |
895 | { | 900 | { |
896 | string query = string.Empty; | 901 | string query = string.Empty; |
897 | 902 | ||
898 | query += "SELECT imviaemail,visible,email FROM "; | 903 | query += "SELECT imviaemail,visible,email FROM "; |
899 | query += "usersettings WHERE "; | 904 | query += "usersettings WHERE "; |
900 | query += "useruuid = ?Id"; | 905 | query += "useruuid = ?Id"; |
901 | 906 | ||
902 | OSDArray data = new OSDArray(); | 907 | OSDArray data = new OSDArray(); |
903 | 908 | ||
904 | try | 909 | try |
905 | { | 910 | { |
906 | using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) | 911 | using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) |
@@ -909,10 +914,9 @@ namespace OpenSim.Data.MySQL | |||
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", pref.UserId.ToString()); |
912 | |||
913 | using (MySqlDataReader reader = cmd.ExecuteReader()) | 917 | using (MySqlDataReader reader = cmd.ExecuteReader()) |
914 | { | 918 | { |
915 | if(reader.HasRows) | 919 | if (reader.HasRows) |
916 | { | 920 | { |
917 | reader.Read(); | 921 | reader.Read(); |
918 | bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail); | 922 | bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail); |
@@ -923,13 +927,13 @@ namespace OpenSim.Data.MySQL | |||
923 | { | 927 | { |
924 | dbcon.Close(); | 928 | dbcon.Close(); |
925 | dbcon.Open(); | 929 | dbcon.Open(); |
926 | 930 | ||
927 | query = "INSERT INTO usersettings VALUES "; | 931 | query = "INSERT INTO usersettings VALUES "; |
928 | query += "(?uuid,'false','false', ?Email)"; | 932 | query += "(?uuid,'false','false', ?Email)"; |
929 | 933 | ||
930 | using (MySqlCommand put = new MySqlCommand(query, dbcon)) | 934 | using (MySqlCommand put = new MySqlCommand(query, dbcon)) |
931 | { | 935 | { |
932 | 936 | ||
933 | put.Parameters.AddWithValue("?Email", pref.EMail); | 937 | put.Parameters.AddWithValue("?Email", pref.EMail); |
934 | put.Parameters.AddWithValue("?uuid", pref.UserId.ToString()); | 938 | put.Parameters.AddWithValue("?uuid", pref.UserId.ToString()); |
935 | 939 | ||
@@ -949,9 +953,9 @@ namespace OpenSim.Data.MySQL | |||
949 | } | 953 | } |
950 | return true; | 954 | return true; |
951 | } | 955 | } |
952 | 956 | ||
953 | public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) | 957 | public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) |
954 | { | 958 | { |
955 | string query = string.Empty; | 959 | string query = string.Empty; |
956 | 960 | ||
957 | query += "UPDATE usersettings SET "; | 961 | query += "UPDATE usersettings SET "; |
@@ -959,7 +963,7 @@ namespace OpenSim.Data.MySQL | |||
959 | query += "visible=?Visible, "; | 963 | query += "visible=?Visible, "; |
960 | query += "email=?EMail "; | 964 | query += "email=?EMail "; |
961 | query += "WHERE useruuid=?uuid"; | 965 | query += "WHERE useruuid=?uuid"; |
962 | 966 | ||
963 | try | 967 | try |
964 | { | 968 | { |
965 | using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) | 969 | using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) |