aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL')
-rw-r--r--OpenSim/Data/PGSQL/PGSQLAssetData.cs3
-rw-r--r--OpenSim/Data/PGSQL/PGSQLSimulationData.cs5
-rw-r--r--OpenSim/Data/PGSQL/PGSQLUserAccountData.cs5
-rw-r--r--OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs29
-rw-r--r--OpenSim/Data/PGSQL/Resources/UserProfiles.migrations9
5 files changed, 27 insertions, 24 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLAssetData.cs b/OpenSim/Data/PGSQL/PGSQLAssetData.cs
index ab74856..7c5c01d 100644
--- a/OpenSim/Data/PGSQL/PGSQLAssetData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLAssetData.cs
@@ -149,7 +149,7 @@ namespace OpenSim.Data.PGSQL
149 /// Create asset in m_database 149 /// Create asset in m_database
150 /// </summary> 150 /// </summary>
151 /// <param name="asset">the asset</param> 151 /// <param name="asset">the asset</param>
152 override public void StoreAsset(AssetBase asset) 152 override public bool StoreAsset(AssetBase asset)
153 { 153 {
154 154
155 string sql = 155 string sql =
@@ -208,6 +208,7 @@ namespace OpenSim.Data.PGSQL
208 m_log.Error("[ASSET DB]: Error storing item :" + e.Message + " sql "+sql); 208 m_log.Error("[ASSET DB]: Error storing item :" + e.Message + " sql "+sql);
209 } 209 }
210 } 210 }
211 return true;
211 } 212 }
212 213
213 214
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
index 354d749..3243635 100644
--- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
@@ -2232,6 +2232,11 @@ namespace OpenSim.Data.PGSQL
2232 } 2232 }
2233 } 2233 }
2234 2234
2235 public UUID[] GetObjectIDs(UUID regionID)
2236 {
2237 return new UUID[0];
2238 }
2239
2235 public void SaveExtra(UUID regionID, string name, string value) 2240 public void SaveExtra(UUID regionID, string name, string value)
2236 { 2241 {
2237 } 2242 }
diff --git a/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs b/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs
index 00f01cb..a5868fe 100644
--- a/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs
@@ -321,5 +321,10 @@ namespace OpenSim.Data.PGSQL
321 return DoQuery(cmd); 321 return DoQuery(cmd);
322 } 322 }
323 } 323 }
324
325 public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
326 {
327 return null;
328 }
324 } 329 }
325} 330}
diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
index 46f57d8..f4e41b4 100644
--- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
@@ -874,7 +874,7 @@ namespace OpenSim.Data.PGSQL
874 } 874 }
875 875
876 #region User Preferences 876 #region User Preferences
877 public bool GetUserPreferences(ref UserPreferences pref, ref string result) 877 public OSDArray GetUserPreferences(UUID avatarId)
878 { 878 {
879 string query = string.Empty; 879 string query = string.Empty;
880 880
@@ -891,16 +891,19 @@ namespace OpenSim.Data.PGSQL
891 dbcon.Open(); 891 dbcon.Open();
892 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon)) 892 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon))
893 { 893 {
894 cmd.Parameters.AddWithValue("Id", pref.UserId.ToString()); 894 cmd.Parameters.AddWithValue("Id", avatarId.ToString());
895 895
896 using (NpgsqlDataReader reader = cmd.ExecuteReader()) 896 using (NpgsqlDataReader reader = cmd.ExecuteReader())
897 { 897 {
898 if(reader.HasRows) 898 if(reader.HasRows)
899 { 899 {
900 reader.Read(); 900 reader.Read();
901 bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail); 901 OSDMap record = new OSDMap();
902 bool.TryParse((string)reader["visible"], out pref.Visible); 902
903 pref.EMail = (string)reader["email"]; 903 record.Add("imviaemail",OSD.FromString((string)reader["imviaemail"]));
904 record.Add("visible",OSD.FromString((string)reader["visible"]));
905 record.Add("email",OSD.FromString((string)reader["email"]));
906 data.Add(record);
904 } 907 }
905 else 908 else
906 { 909 {
@@ -923,16 +926,15 @@ namespace OpenSim.Data.PGSQL
923 { 926 {
924 m_log.DebugFormat("[PROFILES_DATA]" + 927 m_log.DebugFormat("[PROFILES_DATA]" +
925 ": Get preferences exception {0}", e.Message); 928 ": Get preferences exception {0}", e.Message);
926 result = e.Message;
927 } 929 }
928 return true; 930 return data;
929 } 931 }
930 932
931 public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) 933 public bool UpdateUserPreferences(bool emailIm, bool visible, UUID avatarId )
932 { 934 {
933 string query = string.Empty; 935 string query = string.Empty;
934 936
935 query += "UPDATE usersettings SET "; 937 query += "UPDATE userpsettings SET ";
936 query += "imviaemail=:ImViaEmail, "; 938 query += "imviaemail=:ImViaEmail, ";
937 query += "visible=:Visible,"; 939 query += "visible=:Visible,";
938 query += "WHERE useruuid=:uuid"; 940 query += "WHERE useruuid=:uuid";
@@ -944,9 +946,9 @@ namespace OpenSim.Data.PGSQL
944 dbcon.Open(); 946 dbcon.Open();
945 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon)) 947 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon))
946 { 948 {
947 cmd.Parameters.AddWithValue("ImViaEmail", pref.IMViaEmail.ToString().ToLower ()); 949 cmd.Parameters.AddWithValue("ImViaEmail", emailIm.ToString().ToLower ());
948 cmd.Parameters.AddWithValue("Visible", pref.Visible.ToString().ToLower ()); 950 cmd.Parameters.AddWithValue("WantText", visible.ToString().ToLower ());
949 cmd.Parameters.AddWithValue("uuid", pref.UserId.ToString()); 951 cmd.Parameters.AddWithValue("uuid", avatarId.ToString());
950 952
951 lock(Lock) 953 lock(Lock)
952 { 954 {
@@ -959,7 +961,6 @@ namespace OpenSim.Data.PGSQL
959 { 961 {
960 m_log.DebugFormat("[PROFILES_DATA]" + 962 m_log.DebugFormat("[PROFILES_DATA]" +
961 ": AgentInterestsUpdate exception {0}", e.Message); 963 ": AgentInterestsUpdate exception {0}", e.Message);
962 result = e.Message;
963 return false; 964 return false;
964 } 965 }
965 return true; 966 return true;
diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
index 4fcaa8e..f23c870 100644
--- a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
+++ b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
@@ -81,12 +81,3 @@ CREATE TABLE userdata (
81 81
82commit; 82commit;
83 83
84:VERSION 3 # -------------------------------
85begin;
86CREATE TABLE usersettings (
87 "useruuid" char(36) NOT NULL,
88 "imviaemail" bytea NOT NULL,
89 "visible" bytea NOT NULL,
90 PRIMARY KEY ("useruuid")
91);
92commit; \ No newline at end of file