diff options
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAuthenticationData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteEstateData.cs | 12 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteGridUserData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteHGTravelData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 16 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUserAccountData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUserProfilesData.cs | 166 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUtils.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 4 |
11 files changed, 112 insertions, 112 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 9c2bd2e..966d0b8 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -138,7 +138,7 @@ namespace OpenSim.Data.SQLite | |||
138 | { | 138 | { |
139 | assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); | 139 | assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); |
140 | m_log.WarnFormat( | 140 | m_log.WarnFormat( |
141 | "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", | 141 | "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", |
142 | asset.Name, asset.ID, asset.Name.Length, assetName.Length); | 142 | asset.Name, asset.ID, asset.Name.Length, assetName.Length); |
143 | } | 143 | } |
144 | 144 | ||
@@ -147,7 +147,7 @@ namespace OpenSim.Data.SQLite | |||
147 | { | 147 | { |
148 | assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); | 148 | assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); |
149 | m_log.WarnFormat( | 149 | m_log.WarnFormat( |
150 | "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", | 150 | "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", |
151 | asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); | 151 | asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); |
152 | } | 152 | } |
153 | 153 | ||
diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs index 0428c11..8fb955c 100644 --- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs +++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Data.SQLite | |||
45 | public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData | 45 | public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData |
46 | { | 46 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | private string m_Realm; | 49 | private string m_Realm; |
50 | private List<string> m_ColumnNames; | 50 | private List<string> m_ColumnNames; |
51 | private int m_LastExpire; | 51 | private int m_LastExpire; |
@@ -223,7 +223,7 @@ namespace OpenSim.Data.SQLite | |||
223 | if (System.Environment.TickCount - m_LastExpire > 30000) | 223 | if (System.Environment.TickCount - m_LastExpire > 30000) |
224 | DoExpire(); | 224 | DoExpire(); |
225 | 225 | ||
226 | using (SqliteCommand cmd = new SqliteCommand("insert into tokens (UUID, token, validity) values ('" + principalID.ToString() + | 226 | using (SqliteCommand cmd = new SqliteCommand("insert into tokens (UUID, token, validity) values ('" + principalID.ToString() + |
227 | "', '" + token + "', datetime('now', 'localtime', '+" + lifetime.ToString() + " minutes'))")) | 227 | "', '" + token + "', datetime('now', 'localtime', '+" + lifetime.ToString() + " minutes'))")) |
228 | { | 228 | { |
229 | if (ExecuteNonQuery(cmd, m_Connection) > 0) | 229 | if (ExecuteNonQuery(cmd, m_Connection) > 0) |
@@ -238,7 +238,7 @@ namespace OpenSim.Data.SQLite | |||
238 | if (System.Environment.TickCount - m_LastExpire > 30000) | 238 | if (System.Environment.TickCount - m_LastExpire > 30000) |
239 | DoExpire(); | 239 | DoExpire(); |
240 | 240 | ||
241 | using (SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now', 'localtime', '+" + lifetime.ToString() + | 241 | using (SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now', 'localtime', '+" + lifetime.ToString() + |
242 | " minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')")) | 242 | " minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')")) |
243 | { | 243 | { |
244 | if (ExecuteNonQuery(cmd, m_Connection) > 0) | 244 | if (ExecuteNonQuery(cmd, m_Connection) > 0) |
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index d51f2d4..0fcab21 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -190,7 +190,7 @@ namespace OpenSim.Data.SQLite | |||
190 | IDataReader r = null; | 190 | IDataReader r = null; |
191 | 191 | ||
192 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 192 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
193 | { | 193 | { |
194 | names.Remove("EstateID"); | 194 | names.Remove("EstateID"); |
195 | 195 | ||
196 | string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; | 196 | string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; |
@@ -386,15 +386,15 @@ namespace OpenSim.Data.SQLite | |||
386 | return DoLoad(cmd, UUID.Zero, false); | 386 | return DoLoad(cmd, UUID.Zero, false); |
387 | } | 387 | } |
388 | } | 388 | } |
389 | 389 | ||
390 | public List<EstateSettings> LoadEstateSettingsAll() | 390 | public List<EstateSettings> LoadEstateSettingsAll() |
391 | { | 391 | { |
392 | List<EstateSettings> estateSettings = new List<EstateSettings>(); | 392 | List<EstateSettings> estateSettings = new List<EstateSettings>(); |
393 | 393 | ||
394 | List<int> estateIds = GetEstatesAll(); | 394 | List<int> estateIds = GetEstatesAll(); |
395 | foreach (int estateId in estateIds) | 395 | foreach (int estateId in estateIds) |
396 | estateSettings.Add(LoadEstateSettings(estateId)); | 396 | estateSettings.Add(LoadEstateSettings(estateId)); |
397 | 397 | ||
398 | return estateSettings; | 398 | return estateSettings; |
399 | } | 399 | } |
400 | 400 | ||
@@ -421,7 +421,7 @@ namespace OpenSim.Data.SQLite | |||
421 | 421 | ||
422 | return result; | 422 | return result; |
423 | } | 423 | } |
424 | 424 | ||
425 | public List<int> GetEstatesAll() | 425 | public List<int> GetEstatesAll() |
426 | { | 426 | { |
427 | List<int> result = new List<int>(); | 427 | List<int> result = new List<int>(); |
@@ -442,7 +442,7 @@ namespace OpenSim.Data.SQLite | |||
442 | } | 442 | } |
443 | r.Close(); | 443 | r.Close(); |
444 | 444 | ||
445 | return result; | 445 | return result; |
446 | } | 446 | } |
447 | 447 | ||
448 | public List<int> GetEstatesByOwner(UUID ownerID) | 448 | public List<int> GetEstatesByOwner(UUID ownerID) |
diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs index 9fbeb10..a4b84b1 100644 --- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | |||
@@ -189,7 +189,7 @@ namespace OpenSim.Data.SQLite | |||
189 | m_Fields[name].SetValue(row, reader[name]); | 189 | m_Fields[name].SetValue(row, reader[name]); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | if (m_DataField != null) | 193 | if (m_DataField != null) |
194 | { | 194 | { |
195 | Dictionary<string, string> data = | 195 | Dictionary<string, string> data = |
@@ -268,7 +268,7 @@ namespace OpenSim.Data.SQLite | |||
268 | public virtual bool Delete(string field, string key) | 268 | public virtual bool Delete(string field, string key) |
269 | { | 269 | { |
270 | return Delete(new string[] { field }, new string[] { key }); | 270 | return Delete(new string[] { field }, new string[] { key }); |
271 | } | 271 | } |
272 | 272 | ||
273 | public virtual bool Delete(string[] fields, string[] keys) | 273 | public virtual bool Delete(string[] fields, string[] keys) |
274 | { | 274 | { |
diff --git a/OpenSim/Data/SQLite/SQLiteGridUserData.cs b/OpenSim/Data/SQLite/SQLiteGridUserData.cs index d8c52f8..987240c 100644 --- a/OpenSim/Data/SQLite/SQLiteGridUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteGridUserData.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.SQLite | |||
43 | { | 43 | { |
44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | public SQLiteGridUserData(string connectionString, string realm) | 46 | public SQLiteGridUserData(string connectionString, string realm) |
47 | : base(connectionString, realm, "GridUserStore") {} | 47 | : base(connectionString, realm, "GridUserStore") {} |
48 | 48 | ||
49 | public new GridUserData Get(string userID) | 49 | public new GridUserData Get(string userID) |
diff --git a/OpenSim/Data/SQLite/SQLiteHGTravelData.cs b/OpenSim/Data/SQLite/SQLiteHGTravelData.cs index db288b2..dd34710 100644 --- a/OpenSim/Data/SQLite/SQLiteHGTravelData.cs +++ b/OpenSim/Data/SQLite/SQLiteHGTravelData.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Data.SQLite | |||
44 | { | 44 | { |
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | public SQLiteHGTravelData(string connectionString, string realm) | 47 | public SQLiteHGTravelData(string connectionString, string realm) |
48 | : base(connectionString, realm, "HGTravelStore") {} | 48 | : base(connectionString, realm, "HGTravelStore") {} |
49 | 49 | ||
50 | public HGTravelingData Get(UUID sessionID) | 50 | public HGTravelingData Get(UUID sessionID) |
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 5cfc202..eec386f 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -707,7 +707,7 @@ namespace OpenSim.Data.SQLite | |||
707 | DataRow[] primsForRegion = prims.Select(byRegion); | 707 | DataRow[] primsForRegion = prims.Select(byRegion); |
708 | // m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); | 708 | // m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); |
709 | 709 | ||
710 | // First, create all groups | 710 | // First, create all groups |
711 | foreach (DataRow primRow in primsForRegion) | 711 | foreach (DataRow primRow in primsForRegion) |
712 | { | 712 | { |
713 | try | 713 | try |
@@ -733,12 +733,12 @@ namespace OpenSim.Data.SQLite | |||
733 | } | 733 | } |
734 | 734 | ||
735 | SceneObjectGroup group = new SceneObjectGroup(prim); | 735 | SceneObjectGroup group = new SceneObjectGroup(prim); |
736 | 736 | ||
737 | createdObjects.Add(group.UUID, group); | 737 | createdObjects.Add(group.UUID, group); |
738 | retvals.Add(group); | 738 | retvals.Add(group); |
739 | LoadItems(prim); | 739 | LoadItems(prim); |
740 | 740 | ||
741 | 741 | ||
742 | } | 742 | } |
743 | } | 743 | } |
744 | catch (Exception e) | 744 | catch (Exception e) |
@@ -1298,7 +1298,7 @@ namespace OpenSim.Data.SQLite | |||
1298 | createCol(prims, "VolumeDetect", typeof(Int16)); | 1298 | createCol(prims, "VolumeDetect", typeof(Int16)); |
1299 | 1299 | ||
1300 | createCol(prims, "MediaURL", typeof(String)); | 1300 | createCol(prims, "MediaURL", typeof(String)); |
1301 | 1301 | ||
1302 | createCol(prims, "AttachedPosX", typeof(Double)); | 1302 | createCol(prims, "AttachedPosX", typeof(Double)); |
1303 | createCol(prims, "AttachedPosY", typeof(Double)); | 1303 | createCol(prims, "AttachedPosY", typeof(Double)); |
1304 | createCol(prims, "AttachedPosZ", typeof(Double)); | 1304 | createCol(prims, "AttachedPosZ", typeof(Double)); |
@@ -1795,7 +1795,7 @@ namespace OpenSim.Data.SQLite | |||
1795 | // m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); | 1795 | // m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); |
1796 | prim.MediaUrl = (string)row["MediaURL"]; | 1796 | prim.MediaUrl = (string)row["MediaURL"]; |
1797 | } | 1797 | } |
1798 | 1798 | ||
1799 | prim.AttachedPos = new Vector3( | 1799 | prim.AttachedPos = new Vector3( |
1800 | Convert.ToSingle(row["AttachedPosX"]), | 1800 | Convert.ToSingle(row["AttachedPosX"]), |
1801 | Convert.ToSingle(row["AttachedPosY"]), | 1801 | Convert.ToSingle(row["AttachedPosY"]), |
@@ -1806,7 +1806,7 @@ namespace OpenSim.Data.SQLite | |||
1806 | { | 1806 | { |
1807 | //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); | 1807 | //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); |
1808 | prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); | 1808 | prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); |
1809 | } | 1809 | } |
1810 | else | 1810 | else |
1811 | { | 1811 | { |
1812 | prim.DynAttrs = new DAMap(); | 1812 | prim.DynAttrs = new DAMap(); |
@@ -1818,7 +1818,7 @@ namespace OpenSim.Data.SQLite | |||
1818 | prim.Friction = Convert.ToSingle(row["Friction"]); | 1818 | prim.Friction = Convert.ToSingle(row["Friction"]); |
1819 | prim.Restitution = Convert.ToSingle(row["Restitution"]); | 1819 | prim.Restitution = Convert.ToSingle(row["Restitution"]); |
1820 | 1820 | ||
1821 | 1821 | ||
1822 | if (!(row["KeyframeMotion"] is DBNull)) | 1822 | if (!(row["KeyframeMotion"] is DBNull)) |
1823 | { | 1823 | { |
1824 | Byte[] data = (byte[])row["KeyframeMotion"]; | 1824 | Byte[] data = (byte[])row["KeyframeMotion"]; |
@@ -2532,7 +2532,7 @@ namespace OpenSim.Data.SQLite | |||
2532 | 2532 | ||
2533 | if (!(row["Media"] is System.DBNull)) | 2533 | if (!(row["Media"] is System.DBNull)) |
2534 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); | 2534 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); |
2535 | 2535 | ||
2536 | return s; | 2536 | return s; |
2537 | } | 2537 | } |
2538 | 2538 | ||
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs index 91d62ce..1b79185 100644 --- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Data.SQLite | |||
75 | } | 75 | } |
76 | else | 76 | else |
77 | { | 77 | { |
78 | cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')", | 78 | cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')", |
79 | m_Realm, scopeID.ToString(), words[0], words[1]); | 79 | m_Realm, scopeID.ToString(), words[0], words[1]); |
80 | } | 80 | } |
81 | 81 | ||
diff --git a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs index 2dfdba3..13aac79 100644 --- a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs | |||
@@ -46,43 +46,43 @@ namespace OpenSim.Data.SQLite | |||
46 | { | 46 | { |
47 | private static readonly ILog m_log = | 47 | private static readonly ILog m_log = |
48 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | private SqliteConnection m_connection; | 50 | private SqliteConnection m_connection; |
51 | private string m_connectionString; | 51 | private string m_connectionString; |
52 | 52 | ||
53 | private Dictionary<string, FieldInfo> m_FieldMap = | 53 | private Dictionary<string, FieldInfo> m_FieldMap = |
54 | new Dictionary<string, FieldInfo>(); | 54 | new Dictionary<string, FieldInfo>(); |
55 | 55 | ||
56 | protected virtual Assembly Assembly | 56 | protected virtual Assembly Assembly |
57 | { | 57 | { |
58 | get { return GetType().Assembly; } | 58 | get { return GetType().Assembly; } |
59 | } | 59 | } |
60 | 60 | ||
61 | public SQLiteUserProfilesData() | 61 | public SQLiteUserProfilesData() |
62 | { | 62 | { |
63 | } | 63 | } |
64 | 64 | ||
65 | public SQLiteUserProfilesData(string connectionString) | 65 | public SQLiteUserProfilesData(string connectionString) |
66 | { | 66 | { |
67 | Initialise(connectionString); | 67 | Initialise(connectionString); |
68 | } | 68 | } |
69 | 69 | ||
70 | public void Initialise(string connectionString) | 70 | public void Initialise(string connectionString) |
71 | { | 71 | { |
72 | if (Util.IsWindows()) | 72 | if (Util.IsWindows()) |
73 | Util.LoadArchSpecificWindowsDll("sqlite3.dll"); | 73 | Util.LoadArchSpecificWindowsDll("sqlite3.dll"); |
74 | 74 | ||
75 | m_connectionString = connectionString; | 75 | m_connectionString = connectionString; |
76 | 76 | ||
77 | m_log.Info("[PROFILES_DATA]: Sqlite - connecting: "+m_connectionString); | 77 | m_log.Info("[PROFILES_DATA]: Sqlite - connecting: "+m_connectionString); |
78 | 78 | ||
79 | m_connection = new SqliteConnection(m_connectionString); | 79 | m_connection = new SqliteConnection(m_connectionString); |
80 | m_connection.Open(); | 80 | m_connection.Open(); |
81 | 81 | ||
82 | Migration m = new Migration(m_connection, Assembly, "UserProfiles"); | 82 | Migration m = new Migration(m_connection, Assembly, "UserProfiles"); |
83 | m.Update(); | 83 | m.Update(); |
84 | } | 84 | } |
85 | 85 | ||
86 | private string[] FieldList | 86 | private string[] FieldList |
87 | { | 87 | { |
88 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } | 88 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } |
@@ -123,7 +123,7 @@ namespace OpenSim.Data.SQLite | |||
123 | } | 123 | } |
124 | 124 | ||
125 | reader.Close(); | 125 | reader.Close(); |
126 | 126 | ||
127 | return data; | 127 | return data; |
128 | } | 128 | } |
129 | public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result) | 129 | public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result) |
@@ -162,21 +162,21 @@ namespace OpenSim.Data.SQLite | |||
162 | query += ":ParcelName,"; | 162 | query += ":ParcelName,"; |
163 | query += ":Flags,"; | 163 | query += ":Flags,"; |
164 | query += ":ListingPrice ) "; | 164 | query += ":ListingPrice ) "; |
165 | 165 | ||
166 | if(string.IsNullOrEmpty(ad.ParcelName)) | 166 | if(string.IsNullOrEmpty(ad.ParcelName)) |
167 | ad.ParcelName = "Unknown"; | 167 | ad.ParcelName = "Unknown"; |
168 | if(ad.ParcelId == null) | 168 | if(ad.ParcelId == null) |
169 | ad.ParcelId = UUID.Zero; | 169 | ad.ParcelId = UUID.Zero; |
170 | if(string.IsNullOrEmpty(ad.Description)) | 170 | if(string.IsNullOrEmpty(ad.Description)) |
171 | ad.Description = "No Description"; | 171 | ad.Description = "No Description"; |
172 | 172 | ||
173 | DateTime epoch = new DateTime(1970, 1, 1); | 173 | DateTime epoch = new DateTime(1970, 1, 1); |
174 | DateTime now = DateTime.Now; | 174 | DateTime now = DateTime.Now; |
175 | TimeSpan epochnow = now - epoch; | 175 | TimeSpan epochnow = now - epoch; |
176 | TimeSpan duration; | 176 | TimeSpan duration; |
177 | DateTime expiration; | 177 | DateTime expiration; |
178 | TimeSpan epochexp; | 178 | TimeSpan epochexp; |
179 | 179 | ||
180 | if(ad.Flags == 2) | 180 | if(ad.Flags == 2) |
181 | { | 181 | { |
182 | duration = new TimeSpan(7,0,0,0); | 182 | duration = new TimeSpan(7,0,0,0); |
@@ -211,7 +211,7 @@ namespace OpenSim.Data.SQLite | |||
211 | cmd.Parameters.AddWithValue(":ParcelName", ad.ParcelName.ToString()); | 211 | cmd.Parameters.AddWithValue(":ParcelName", ad.ParcelName.ToString()); |
212 | cmd.Parameters.AddWithValue(":Flags", ad.Flags.ToString()); | 212 | cmd.Parameters.AddWithValue(":Flags", ad.Flags.ToString()); |
213 | cmd.Parameters.AddWithValue(":ListingPrice", ad.Price.ToString ()); | 213 | cmd.Parameters.AddWithValue(":ListingPrice", ad.Price.ToString ()); |
214 | 214 | ||
215 | cmd.ExecuteNonQuery(); | 215 | cmd.ExecuteNonQuery(); |
216 | } | 216 | } |
217 | } | 217 | } |
@@ -227,17 +227,17 @@ namespace OpenSim.Data.SQLite | |||
227 | public bool DeleteClassifiedRecord(UUID recordId) | 227 | public bool DeleteClassifiedRecord(UUID recordId) |
228 | { | 228 | { |
229 | string query = string.Empty; | 229 | string query = string.Empty; |
230 | 230 | ||
231 | query += "DELETE FROM classifieds WHERE "; | 231 | query += "DELETE FROM classifieds WHERE "; |
232 | query += "classifieduuid = :ClasifiedId"; | 232 | query += "classifieduuid = :ClasifiedId"; |
233 | 233 | ||
234 | try | 234 | try |
235 | { | 235 | { |
236 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 236 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
237 | { | 237 | { |
238 | cmd.CommandText = query; | 238 | cmd.CommandText = query; |
239 | cmd.Parameters.AddWithValue(":ClassifiedId", recordId.ToString()); | 239 | cmd.Parameters.AddWithValue(":ClassifiedId", recordId.ToString()); |
240 | 240 | ||
241 | cmd.ExecuteNonQuery(); | 241 | cmd.ExecuteNonQuery(); |
242 | } | 242 | } |
243 | } | 243 | } |
@@ -254,17 +254,17 @@ namespace OpenSim.Data.SQLite | |||
254 | { | 254 | { |
255 | IDataReader reader = null; | 255 | IDataReader reader = null; |
256 | string query = string.Empty; | 256 | string query = string.Empty; |
257 | 257 | ||
258 | query += "SELECT * FROM classifieds WHERE "; | 258 | query += "SELECT * FROM classifieds WHERE "; |
259 | query += "classifieduuid = :AdId"; | 259 | query += "classifieduuid = :AdId"; |
260 | 260 | ||
261 | try | 261 | try |
262 | { | 262 | { |
263 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 263 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
264 | { | 264 | { |
265 | cmd.CommandText = query; | 265 | cmd.CommandText = query; |
266 | cmd.Parameters.AddWithValue(":AdId", ad.ClassifiedId.ToString()); | 266 | cmd.Parameters.AddWithValue(":AdId", ad.ClassifiedId.ToString()); |
267 | 267 | ||
268 | using (reader = cmd.ExecuteReader()) | 268 | using (reader = cmd.ExecuteReader()) |
269 | { | 269 | { |
270 | if(reader.Read ()) | 270 | if(reader.Read ()) |
@@ -299,24 +299,24 @@ namespace OpenSim.Data.SQLite | |||
299 | { | 299 | { |
300 | IDataReader reader = null; | 300 | IDataReader reader = null; |
301 | string query = string.Empty; | 301 | string query = string.Empty; |
302 | 302 | ||
303 | query += "SELECT `pickuuid`,`name` FROM userpicks WHERE "; | 303 | query += "SELECT `pickuuid`,`name` FROM userpicks WHERE "; |
304 | query += "creatoruuid = :Id"; | 304 | query += "creatoruuid = :Id"; |
305 | OSDArray data = new OSDArray(); | 305 | OSDArray data = new OSDArray(); |
306 | 306 | ||
307 | try | 307 | try |
308 | { | 308 | { |
309 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 309 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
310 | { | 310 | { |
311 | cmd.CommandText = query; | 311 | cmd.CommandText = query; |
312 | cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); | 312 | cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); |
313 | 313 | ||
314 | using (reader = cmd.ExecuteReader()) | 314 | using (reader = cmd.ExecuteReader()) |
315 | { | 315 | { |
316 | while (reader.Read()) | 316 | while (reader.Read()) |
317 | { | 317 | { |
318 | OSDMap record = new OSDMap(); | 318 | OSDMap record = new OSDMap(); |
319 | 319 | ||
320 | record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"])); | 320 | record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"])); |
321 | record.Add("name",OSD.FromString((string)reader["name"])); | 321 | record.Add("name",OSD.FromString((string)reader["name"])); |
322 | data.Add(record); | 322 | data.Add(record); |
@@ -336,11 +336,11 @@ namespace OpenSim.Data.SQLite | |||
336 | IDataReader reader = null; | 336 | IDataReader reader = null; |
337 | string query = string.Empty; | 337 | string query = string.Empty; |
338 | UserProfilePick pick = new UserProfilePick(); | 338 | UserProfilePick pick = new UserProfilePick(); |
339 | 339 | ||
340 | query += "SELECT * FROM userpicks WHERE "; | 340 | query += "SELECT * FROM userpicks WHERE "; |
341 | query += "creatoruuid = :CreatorId AND "; | 341 | query += "creatoruuid = :CreatorId AND "; |
342 | query += "pickuuid = :PickId"; | 342 | query += "pickuuid = :PickId"; |
343 | 343 | ||
344 | try | 344 | try |
345 | { | 345 | { |
346 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 346 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -348,17 +348,17 @@ namespace OpenSim.Data.SQLite | |||
348 | cmd.CommandText = query; | 348 | cmd.CommandText = query; |
349 | cmd.Parameters.AddWithValue(":CreatorId", avatarId.ToString()); | 349 | cmd.Parameters.AddWithValue(":CreatorId", avatarId.ToString()); |
350 | cmd.Parameters.AddWithValue(":PickId", pickId.ToString()); | 350 | cmd.Parameters.AddWithValue(":PickId", pickId.ToString()); |
351 | 351 | ||
352 | using (reader = cmd.ExecuteReader()) | 352 | using (reader = cmd.ExecuteReader()) |
353 | { | 353 | { |
354 | 354 | ||
355 | while (reader.Read()) | 355 | while (reader.Read()) |
356 | { | 356 | { |
357 | string description = (string)reader["description"]; | 357 | string description = (string)reader["description"]; |
358 | 358 | ||
359 | if (string.IsNullOrEmpty(description)) | 359 | if (string.IsNullOrEmpty(description)) |
360 | description = "No description given."; | 360 | description = "No description given."; |
361 | 361 | ||
362 | UUID.TryParse((string)reader["pickuuid"], out pick.PickId); | 362 | UUID.TryParse((string)reader["pickuuid"], out pick.PickId); |
363 | UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId); | 363 | UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId); |
364 | UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId); | 364 | UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId); |
@@ -385,7 +385,7 @@ namespace OpenSim.Data.SQLite | |||
385 | } | 385 | } |
386 | 386 | ||
387 | public bool UpdatePicksRecord(UserProfilePick pick) | 387 | public bool UpdatePicksRecord(UserProfilePick pick) |
388 | { | 388 | { |
389 | string query = string.Empty; | 389 | string query = string.Empty; |
390 | 390 | ||
391 | query += "INSERT OR REPLACE INTO userpicks ("; | 391 | query += "INSERT OR REPLACE INTO userpicks ("; |
@@ -416,7 +416,7 @@ namespace OpenSim.Data.SQLite | |||
416 | query += ":GlobalPos,"; | 416 | query += ":GlobalPos,"; |
417 | query += ":SortOrder,"; | 417 | query += ":SortOrder,"; |
418 | query += ":Enabled) "; | 418 | query += ":Enabled) "; |
419 | 419 | ||
420 | try | 420 | try |
421 | { | 421 | { |
422 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 422 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -456,10 +456,10 @@ namespace OpenSim.Data.SQLite | |||
456 | public bool DeletePicksRecord(UUID pickId) | 456 | public bool DeletePicksRecord(UUID pickId) |
457 | { | 457 | { |
458 | string query = string.Empty; | 458 | string query = string.Empty; |
459 | 459 | ||
460 | query += "DELETE FROM userpicks WHERE "; | 460 | query += "DELETE FROM userpicks WHERE "; |
461 | query += "pickuuid = :PickId"; | 461 | query += "pickuuid = :PickId"; |
462 | 462 | ||
463 | try | 463 | try |
464 | { | 464 | { |
465 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 465 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -479,15 +479,15 @@ namespace OpenSim.Data.SQLite | |||
479 | } | 479 | } |
480 | 480 | ||
481 | public bool GetAvatarNotes(ref UserProfileNotes notes) | 481 | public bool GetAvatarNotes(ref UserProfileNotes notes) |
482 | { | 482 | { |
483 | IDataReader reader = null; | 483 | IDataReader reader = null; |
484 | string query = string.Empty; | 484 | string query = string.Empty; |
485 | 485 | ||
486 | query += "SELECT `notes` FROM usernotes WHERE "; | 486 | query += "SELECT `notes` FROM usernotes WHERE "; |
487 | query += "useruuid = :Id AND "; | 487 | query += "useruuid = :Id AND "; |
488 | query += "targetuuid = :TargetId"; | 488 | query += "targetuuid = :TargetId"; |
489 | OSDArray data = new OSDArray(); | 489 | OSDArray data = new OSDArray(); |
490 | 490 | ||
491 | try | 491 | try |
492 | { | 492 | { |
493 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 493 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -495,7 +495,7 @@ namespace OpenSim.Data.SQLite | |||
495 | cmd.CommandText = query; | 495 | cmd.CommandText = query; |
496 | cmd.Parameters.AddWithValue(":Id", notes.UserId.ToString()); | 496 | cmd.Parameters.AddWithValue(":Id", notes.UserId.ToString()); |
497 | cmd.Parameters.AddWithValue(":TargetId", notes.TargetId.ToString()); | 497 | cmd.Parameters.AddWithValue(":TargetId", notes.TargetId.ToString()); |
498 | 498 | ||
499 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 499 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
500 | { | 500 | { |
501 | while (reader.Read()) | 501 | while (reader.Read()) |
@@ -514,10 +514,10 @@ namespace OpenSim.Data.SQLite | |||
514 | } | 514 | } |
515 | 515 | ||
516 | public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result) | 516 | public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result) |
517 | { | 517 | { |
518 | string query = string.Empty; | 518 | string query = string.Empty; |
519 | bool remove; | 519 | bool remove; |
520 | 520 | ||
521 | if(string.IsNullOrEmpty(note.Notes)) | 521 | if(string.IsNullOrEmpty(note.Notes)) |
522 | { | 522 | { |
523 | remove = true; | 523 | remove = true; |
@@ -533,7 +533,7 @@ namespace OpenSim.Data.SQLite | |||
533 | query += ":TargetId,"; | 533 | query += ":TargetId,"; |
534 | query += ":Notes )"; | 534 | query += ":Notes )"; |
535 | } | 535 | } |
536 | 536 | ||
537 | try | 537 | try |
538 | { | 538 | { |
539 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 539 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -544,7 +544,7 @@ namespace OpenSim.Data.SQLite | |||
544 | cmd.Parameters.AddWithValue(":Notes", note.Notes); | 544 | cmd.Parameters.AddWithValue(":Notes", note.Notes); |
545 | cmd.Parameters.AddWithValue(":TargetId", note.TargetId.ToString ()); | 545 | cmd.Parameters.AddWithValue(":TargetId", note.TargetId.ToString ()); |
546 | cmd.Parameters.AddWithValue(":UserId", note.UserId.ToString()); | 546 | cmd.Parameters.AddWithValue(":UserId", note.UserId.ToString()); |
547 | 547 | ||
548 | cmd.ExecuteNonQuery(); | 548 | cmd.ExecuteNonQuery(); |
549 | } | 549 | } |
550 | } | 550 | } |
@@ -561,7 +561,7 @@ namespace OpenSim.Data.SQLite | |||
561 | { | 561 | { |
562 | IDataReader reader = null; | 562 | IDataReader reader = null; |
563 | string query = string.Empty; | 563 | string query = string.Empty; |
564 | 564 | ||
565 | query += "SELECT * FROM userprofile WHERE "; | 565 | query += "SELECT * FROM userprofile WHERE "; |
566 | query += "useruuid = :Id"; | 566 | query += "useruuid = :Id"; |
567 | 567 | ||
@@ -569,7 +569,7 @@ namespace OpenSim.Data.SQLite | |||
569 | { | 569 | { |
570 | cmd.CommandText = query; | 570 | cmd.CommandText = query; |
571 | cmd.Parameters.AddWithValue(":Id", props.UserId.ToString()); | 571 | cmd.Parameters.AddWithValue(":Id", props.UserId.ToString()); |
572 | 572 | ||
573 | 573 | ||
574 | try | 574 | try |
575 | { | 575 | { |
@@ -611,7 +611,7 @@ namespace OpenSim.Data.SQLite | |||
611 | props.Language = string.Empty; | 611 | props.Language = string.Empty; |
612 | props.PublishProfile = false; | 612 | props.PublishProfile = false; |
613 | props.PublishMature = false; | 613 | props.PublishMature = false; |
614 | 614 | ||
615 | query = "INSERT INTO userprofile ("; | 615 | query = "INSERT INTO userprofile ("; |
616 | query += "useruuid, "; | 616 | query += "useruuid, "; |
617 | query += "profilePartner, "; | 617 | query += "profilePartner, "; |
@@ -659,7 +659,7 @@ namespace OpenSim.Data.SQLite | |||
659 | put.Parameters.AddWithValue(":profileAboutText", props.AboutText); | 659 | put.Parameters.AddWithValue(":profileAboutText", props.AboutText); |
660 | put.Parameters.AddWithValue(":profileFirstImage", props.FirstLifeImageId.ToString()); | 660 | put.Parameters.AddWithValue(":profileFirstImage", props.FirstLifeImageId.ToString()); |
661 | put.Parameters.AddWithValue(":profileFirstText", props.FirstLifeText); | 661 | put.Parameters.AddWithValue(":profileFirstText", props.FirstLifeText); |
662 | 662 | ||
663 | put.ExecuteNonQuery(); | 663 | put.ExecuteNonQuery(); |
664 | } | 664 | } |
665 | } | 665 | } |
@@ -668,9 +668,9 @@ namespace OpenSim.Data.SQLite | |||
668 | } | 668 | } |
669 | 669 | ||
670 | public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result) | 670 | public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result) |
671 | { | 671 | { |
672 | string query = string.Empty; | 672 | string query = string.Empty; |
673 | 673 | ||
674 | query += "UPDATE userprofile SET "; | 674 | query += "UPDATE userprofile SET "; |
675 | query += "profileURL=:profileURL, "; | 675 | query += "profileURL=:profileURL, "; |
676 | query += "profileImage=:image, "; | 676 | query += "profileImage=:image, "; |
@@ -678,7 +678,7 @@ namespace OpenSim.Data.SQLite | |||
678 | query += "profileFirstImage=:firstlifeimage,"; | 678 | query += "profileFirstImage=:firstlifeimage,"; |
679 | query += "profileFirstText=:firstlifetext "; | 679 | query += "profileFirstText=:firstlifetext "; |
680 | query += "WHERE useruuid=:uuid"; | 680 | query += "WHERE useruuid=:uuid"; |
681 | 681 | ||
682 | try | 682 | try |
683 | { | 683 | { |
684 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 684 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -690,7 +690,7 @@ namespace OpenSim.Data.SQLite | |||
690 | cmd.Parameters.AddWithValue(":firstlifeimage", props.FirstLifeImageId.ToString()); | 690 | cmd.Parameters.AddWithValue(":firstlifeimage", props.FirstLifeImageId.ToString()); |
691 | cmd.Parameters.AddWithValue(":firstlifetext", props.FirstLifeText); | 691 | cmd.Parameters.AddWithValue(":firstlifetext", props.FirstLifeText); |
692 | cmd.Parameters.AddWithValue(":uuid", props.UserId.ToString()); | 692 | cmd.Parameters.AddWithValue(":uuid", props.UserId.ToString()); |
693 | 693 | ||
694 | cmd.ExecuteNonQuery(); | 694 | cmd.ExecuteNonQuery(); |
695 | } | 695 | } |
696 | } | 696 | } |
@@ -698,16 +698,16 @@ namespace OpenSim.Data.SQLite | |||
698 | { | 698 | { |
699 | m_log.ErrorFormat("[PROFILES_DATA]" + | 699 | m_log.ErrorFormat("[PROFILES_DATA]" + |
700 | ": AgentPropertiesUpdate exception {0}", e.Message); | 700 | ": AgentPropertiesUpdate exception {0}", e.Message); |
701 | 701 | ||
702 | return false; | 702 | return false; |
703 | } | 703 | } |
704 | return true; | 704 | return true; |
705 | } | 705 | } |
706 | 706 | ||
707 | public bool UpdateAvatarInterests(UserProfileProperties up, ref string result) | 707 | public bool UpdateAvatarInterests(UserProfileProperties up, ref string result) |
708 | { | 708 | { |
709 | string query = string.Empty; | 709 | string query = string.Empty; |
710 | 710 | ||
711 | query += "UPDATE userprofile SET "; | 711 | query += "UPDATE userprofile SET "; |
712 | query += "profileWantToMask=:WantMask, "; | 712 | query += "profileWantToMask=:WantMask, "; |
713 | query += "profileWantToText=:WantText,"; | 713 | query += "profileWantToText=:WantText,"; |
@@ -715,7 +715,7 @@ namespace OpenSim.Data.SQLite | |||
715 | query += "profileSkillsText=:SkillsText, "; | 715 | query += "profileSkillsText=:SkillsText, "; |
716 | query += "profileLanguages=:Languages "; | 716 | query += "profileLanguages=:Languages "; |
717 | query += "WHERE useruuid=:uuid"; | 717 | query += "WHERE useruuid=:uuid"; |
718 | 718 | ||
719 | try | 719 | try |
720 | { | 720 | { |
721 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 721 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -727,7 +727,7 @@ namespace OpenSim.Data.SQLite | |||
727 | cmd.Parameters.AddWithValue(":SkillsText", up.SkillsText); | 727 | cmd.Parameters.AddWithValue(":SkillsText", up.SkillsText); |
728 | cmd.Parameters.AddWithValue(":Languages", up.Language); | 728 | cmd.Parameters.AddWithValue(":Languages", up.Language); |
729 | cmd.Parameters.AddWithValue(":uuid", up.UserId.ToString()); | 729 | cmd.Parameters.AddWithValue(":uuid", up.UserId.ToString()); |
730 | 730 | ||
731 | cmd.ExecuteNonQuery(); | 731 | cmd.ExecuteNonQuery(); |
732 | } | 732 | } |
733 | } | 733 | } |
@@ -741,17 +741,17 @@ namespace OpenSim.Data.SQLite | |||
741 | return true; | 741 | return true; |
742 | } | 742 | } |
743 | 743 | ||
744 | 744 | ||
745 | public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) | 745 | public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) |
746 | { | 746 | { |
747 | string query = string.Empty; | 747 | string query = string.Empty; |
748 | 748 | ||
749 | query += "UPDATE usersettings SET "; | 749 | query += "UPDATE usersettings SET "; |
750 | query += "imviaemail=:ImViaEmail, "; | 750 | query += "imviaemail=:ImViaEmail, "; |
751 | query += "visible=:Visible, "; | 751 | query += "visible=:Visible, "; |
752 | query += "email=:EMail "; | 752 | query += "email=:EMail "; |
753 | query += "WHERE useruuid=:uuid"; | 753 | query += "WHERE useruuid=:uuid"; |
754 | 754 | ||
755 | try | 755 | try |
756 | { | 756 | { |
757 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 757 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -761,7 +761,7 @@ namespace OpenSim.Data.SQLite | |||
761 | cmd.Parameters.AddWithValue(":Visible", pref.Visible); | 761 | cmd.Parameters.AddWithValue(":Visible", pref.Visible); |
762 | cmd.Parameters.AddWithValue(":EMail", pref.EMail); | 762 | cmd.Parameters.AddWithValue(":EMail", pref.EMail); |
763 | cmd.Parameters.AddWithValue(":uuid", pref.UserId.ToString()); | 763 | cmd.Parameters.AddWithValue(":uuid", pref.UserId.ToString()); |
764 | 764 | ||
765 | cmd.ExecuteNonQuery(); | 765 | cmd.ExecuteNonQuery(); |
766 | } | 766 | } |
767 | } | 767 | } |
@@ -779,20 +779,20 @@ namespace OpenSim.Data.SQLite | |||
779 | { | 779 | { |
780 | IDataReader reader = null; | 780 | IDataReader reader = null; |
781 | string query = string.Empty; | 781 | string query = string.Empty; |
782 | 782 | ||
783 | query += "SELECT imviaemail,visible,email FROM "; | 783 | query += "SELECT imviaemail,visible,email FROM "; |
784 | query += "usersettings WHERE "; | 784 | query += "usersettings WHERE "; |
785 | query += "useruuid = :Id"; | 785 | query += "useruuid = :Id"; |
786 | 786 | ||
787 | OSDArray data = new OSDArray(); | 787 | OSDArray data = new OSDArray(); |
788 | 788 | ||
789 | try | 789 | try |
790 | { | 790 | { |
791 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 791 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
792 | { | 792 | { |
793 | cmd.CommandText = query; | 793 | cmd.CommandText = query; |
794 | cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString()); | 794 | cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString()); |
795 | 795 | ||
796 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 796 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
797 | { | 797 | { |
798 | if(reader.Read()) | 798 | if(reader.Read()) |
@@ -805,13 +805,13 @@ namespace OpenSim.Data.SQLite | |||
805 | { | 805 | { |
806 | query = "INSERT INTO usersettings VALUES "; | 806 | query = "INSERT INTO usersettings VALUES "; |
807 | query += "(:Id,'false','false', :Email)"; | 807 | query += "(:Id,'false','false', :Email)"; |
808 | 808 | ||
809 | using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) | 809 | using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) |
810 | { | 810 | { |
811 | put.Parameters.AddWithValue(":Id", pref.UserId.ToString()); | 811 | put.Parameters.AddWithValue(":Id", pref.UserId.ToString()); |
812 | put.Parameters.AddWithValue(":Email", pref.EMail); | 812 | put.Parameters.AddWithValue(":Email", pref.EMail); |
813 | put.ExecuteNonQuery(); | 813 | put.ExecuteNonQuery(); |
814 | 814 | ||
815 | } | 815 | } |
816 | } | 816 | } |
817 | } | 817 | } |
@@ -831,11 +831,11 @@ namespace OpenSim.Data.SQLite | |||
831 | { | 831 | { |
832 | IDataReader reader = null; | 832 | IDataReader reader = null; |
833 | string query = string.Empty; | 833 | string query = string.Empty; |
834 | 834 | ||
835 | query += "SELECT * FROM `userdata` WHERE "; | 835 | query += "SELECT * FROM `userdata` WHERE "; |
836 | query += "UserId = :Id AND "; | 836 | query += "UserId = :Id AND "; |
837 | query += "TagId = :TagId"; | 837 | query += "TagId = :TagId"; |
838 | 838 | ||
839 | try | 839 | try |
840 | { | 840 | { |
841 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 841 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -843,7 +843,7 @@ namespace OpenSim.Data.SQLite | |||
843 | cmd.CommandText = query; | 843 | cmd.CommandText = query; |
844 | cmd.Parameters.AddWithValue(":Id", props.UserId.ToString()); | 844 | cmd.Parameters.AddWithValue(":Id", props.UserId.ToString()); |
845 | cmd.Parameters.AddWithValue (":TagId", props.TagId.ToString()); | 845 | cmd.Parameters.AddWithValue (":TagId", props.TagId.ToString()); |
846 | 846 | ||
847 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 847 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
848 | { | 848 | { |
849 | if(reader.Read()) | 849 | if(reader.Read()) |
@@ -858,7 +858,7 @@ namespace OpenSim.Data.SQLite | |||
858 | query += ":TagId,"; | 858 | query += ":TagId,"; |
859 | query += ":DataKey,"; | 859 | query += ":DataKey,"; |
860 | query += ":DataVal) "; | 860 | query += ":DataVal) "; |
861 | 861 | ||
862 | using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) | 862 | using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) |
863 | { | 863 | { |
864 | put.Parameters.AddWithValue(":Id", props.UserId.ToString()); | 864 | put.Parameters.AddWithValue(":Id", props.UserId.ToString()); |
@@ -882,16 +882,16 @@ namespace OpenSim.Data.SQLite | |||
882 | return true; | 882 | return true; |
883 | } | 883 | } |
884 | public bool SetUserAppData(UserAppData props, ref string result) | 884 | public bool SetUserAppData(UserAppData props, ref string result) |
885 | { | 885 | { |
886 | string query = string.Empty; | 886 | string query = string.Empty; |
887 | 887 | ||
888 | query += "UPDATE userdata SET "; | 888 | query += "UPDATE userdata SET "; |
889 | query += "TagId = :TagId, "; | 889 | query += "TagId = :TagId, "; |
890 | query += "DataKey = :DataKey, "; | 890 | query += "DataKey = :DataKey, "; |
891 | query += "DataVal = :DataVal WHERE "; | 891 | query += "DataVal = :DataVal WHERE "; |
892 | query += "UserId = :UserId AND "; | 892 | query += "UserId = :UserId AND "; |
893 | query += "TagId = :TagId"; | 893 | query += "TagId = :TagId"; |
894 | 894 | ||
895 | try | 895 | try |
896 | { | 896 | { |
897 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 897 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
@@ -918,17 +918,17 @@ namespace OpenSim.Data.SQLite | |||
918 | IDataReader reader = null; | 918 | IDataReader reader = null; |
919 | OSDArray data = new OSDArray(); | 919 | OSDArray data = new OSDArray(); |
920 | string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = :Id"; | 920 | string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = :Id"; |
921 | 921 | ||
922 | // Get classified image assets | 922 | // Get classified image assets |
923 | 923 | ||
924 | 924 | ||
925 | try | 925 | try |
926 | { | 926 | { |
927 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 927 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
928 | { | 928 | { |
929 | cmd.CommandText = query; | 929 | cmd.CommandText = query; |
930 | cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); | 930 | cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); |
931 | 931 | ||
932 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 932 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
933 | { | 933 | { |
934 | while(reader.Read()) | 934 | while(reader.Read()) |
@@ -942,7 +942,7 @@ namespace OpenSim.Data.SQLite | |||
942 | { | 942 | { |
943 | cmd.CommandText = query; | 943 | cmd.CommandText = query; |
944 | cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); | 944 | cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); |
945 | 945 | ||
946 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 946 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
947 | { | 947 | { |
948 | if(reader.Read()) | 948 | if(reader.Read()) |
@@ -951,14 +951,14 @@ namespace OpenSim.Data.SQLite | |||
951 | } | 951 | } |
952 | } | 952 | } |
953 | } | 953 | } |
954 | 954 | ||
955 | query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = :Id"; | 955 | query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = :Id"; |
956 | 956 | ||
957 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) | 957 | using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) |
958 | { | 958 | { |
959 | cmd.CommandText = query; | 959 | cmd.CommandText = query; |
960 | cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); | 960 | cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); |
961 | 961 | ||
962 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 962 | using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
963 | { | 963 | { |
964 | if(reader.Read()) | 964 | if(reader.Read()) |
diff --git a/OpenSim/Data/SQLite/SQLiteUtils.cs b/OpenSim/Data/SQLite/SQLiteUtils.cs index ca5861f..1218ebb 100644 --- a/OpenSim/Data/SQLite/SQLiteUtils.cs +++ b/OpenSim/Data/SQLite/SQLiteUtils.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Data.SQLite | |||
49 | **********************************************************************/ | 49 | **********************************************************************/ |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// | 52 | /// |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <param name="dt"></param> | 54 | /// <param name="dt"></param> |
55 | /// <param name="name"></param> | 55 | /// <param name="name"></param> |
@@ -147,7 +147,7 @@ namespace OpenSim.Data.SQLite | |||
147 | } | 147 | } |
148 | 148 | ||
149 | /// <summary> | 149 | /// <summary> |
150 | /// | 150 | /// |
151 | /// </summary> | 151 | /// </summary> |
152 | /// <param name="dt">Data Table</param> | 152 | /// <param name="dt">Data Table</param> |
153 | /// <returns></returns> | 153 | /// <returns></returns> |
@@ -191,7 +191,7 @@ namespace OpenSim.Data.SQLite | |||
191 | /// lines for defining SqliteParameters to 2 parameters: | 191 | /// lines for defining SqliteParameters to 2 parameters: |
192 | /// column name and database type. | 192 | /// column name and database type. |
193 | /// </para> | 193 | /// </para> |
194 | /// | 194 | /// |
195 | /// <para> | 195 | /// <para> |
196 | /// It assumes certain conventions like :param as the param | 196 | /// It assumes certain conventions like :param as the param |
197 | /// name to replace in parametrized queries, and that source | 197 | /// name to replace in parametrized queries, and that source |
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index 2a0a8f6..7f44a65 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs | |||
@@ -107,7 +107,7 @@ namespace OpenSim.Data.SQLite | |||
107 | public bool DeleteItems(string[] fields, string[] vals) | 107 | public bool DeleteItems(string[] fields, string[] vals) |
108 | { | 108 | { |
109 | return m_Items.Delete(fields, vals); | 109 | return m_Items.Delete(fields, vals); |
110 | } | 110 | } |
111 | 111 | ||
112 | public bool MoveItem(string id, string newParent) | 112 | public bool MoveItem(string id, string newParent) |
113 | { | 113 | { |
@@ -302,7 +302,7 @@ namespace OpenSim.Data.SQLite | |||
302 | { | 302 | { |
303 | // m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID); | 303 | // m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID); |
304 | // Util.PrintCallStack(); | 304 | // Util.PrintCallStack(); |
305 | 305 | ||
306 | using (SqliteCommand cmd = new SqliteCommand()) | 306 | using (SqliteCommand cmd = new SqliteCommand()) |
307 | { | 307 | { |
308 | cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID"; | 308 | cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID"; |