diff options
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLEstateData.cs | 26 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteEstateData.cs | 24 |
3 files changed, 31 insertions, 27 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index f8641bc..78d4446 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs | |||
@@ -101,8 +101,10 @@ namespace OpenSim.Data.MySQL | |||
101 | BindingFlags.DeclaredOnly); | 101 | BindingFlags.DeclaredOnly); |
102 | 102 | ||
103 | foreach (FieldInfo f in m_Fields) | 103 | foreach (FieldInfo f in m_Fields) |
104 | if(f.Name.Substring(0, 2) == "m_") | 104 | { |
105 | if (f.Name.Substring(0, 2) == "m_") | ||
105 | m_FieldMap[f.Name.Substring(2)] = f; | 106 | m_FieldMap[f.Name.Substring(2)] = f; |
107 | } | ||
106 | } | 108 | } |
107 | 109 | ||
108 | private string[] FieldList | 110 | private string[] FieldList |
@@ -171,14 +173,14 @@ namespace OpenSim.Data.MySQL | |||
171 | 173 | ||
172 | IDataReader r = cmd.ExecuteReader(); | 174 | IDataReader r = cmd.ExecuteReader(); |
173 | 175 | ||
174 | if(r.Read()) | 176 | if (r.Read()) |
175 | { | 177 | { |
176 | foreach (string name in FieldList) | 178 | foreach (string name in FieldList) |
177 | { | 179 | { |
178 | if(m_FieldMap[name].GetValue(es) is bool) | 180 | if (m_FieldMap[name].GetValue(es) is bool) |
179 | { | 181 | { |
180 | int v = Convert.ToInt32(r[name]); | 182 | int v = Convert.ToInt32(r[name]); |
181 | if(v != 0) | 183 | if (v != 0) |
182 | m_FieldMap[name].SetValue(es, true); | 184 | m_FieldMap[name].SetValue(es, true); |
183 | else | 185 | else |
184 | m_FieldMap[name].SetValue(es, false); | 186 | m_FieldMap[name].SetValue(es, false); |
@@ -207,9 +209,9 @@ namespace OpenSim.Data.MySQL | |||
207 | 209 | ||
208 | foreach (string name in FieldList) | 210 | foreach (string name in FieldList) |
209 | { | 211 | { |
210 | if(m_FieldMap[name].GetValue(es) is bool) | 212 | if (m_FieldMap[name].GetValue(es) is bool) |
211 | { | 213 | { |
212 | if((bool)m_FieldMap[name].GetValue(es)) | 214 | if ((bool)m_FieldMap[name].GetValue(es)) |
213 | cmd.Parameters.AddWithValue("?"+name, "1"); | 215 | cmd.Parameters.AddWithValue("?"+name, "1"); |
214 | else | 216 | else |
215 | cmd.Parameters.AddWithValue("?"+name, "0"); | 217 | cmd.Parameters.AddWithValue("?"+name, "0"); |
@@ -283,9 +285,9 @@ namespace OpenSim.Data.MySQL | |||
283 | 285 | ||
284 | foreach (string name in FieldList) | 286 | foreach (string name in FieldList) |
285 | { | 287 | { |
286 | if(m_FieldMap[name].GetValue(es) is bool) | 288 | if (m_FieldMap[name].GetValue(es) is bool) |
287 | { | 289 | { |
288 | if((bool)m_FieldMap[name].GetValue(es)) | 290 | if ((bool)m_FieldMap[name].GetValue(es)) |
289 | cmd.Parameters.AddWithValue("?"+name, "1"); | 291 | cmd.Parameters.AddWithValue("?"+name, "1"); |
290 | else | 292 | else |
291 | cmd.Parameters.AddWithValue("?"+name, "0"); | 293 | cmd.Parameters.AddWithValue("?"+name, "0"); |
@@ -317,7 +319,7 @@ namespace OpenSim.Data.MySQL | |||
317 | 319 | ||
318 | IDataReader r = cmd.ExecuteReader(); | 320 | IDataReader r = cmd.ExecuteReader(); |
319 | 321 | ||
320 | while(r.Read()) | 322 | while (r.Read()) |
321 | { | 323 | { |
322 | EstateBan eb = new EstateBan(); | 324 | EstateBan eb = new EstateBan(); |
323 | 325 | ||
@@ -347,7 +349,7 @@ namespace OpenSim.Data.MySQL | |||
347 | 349 | ||
348 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )"; | 350 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )"; |
349 | 351 | ||
350 | foreach(EstateBan b in es.EstateBans) | 352 | foreach (EstateBan b in es.EstateBans) |
351 | { | 353 | { |
352 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); | 354 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); |
353 | cmd.Parameters.AddWithValue("?bannedUUID", b.bannedUUID.ToString()); | 355 | cmd.Parameters.AddWithValue("?bannedUUID", b.bannedUUID.ToString()); |
@@ -372,7 +374,7 @@ namespace OpenSim.Data.MySQL | |||
372 | 374 | ||
373 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )"; | 375 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )"; |
374 | 376 | ||
375 | foreach(LLUUID uuid in data) | 377 | foreach (LLUUID uuid in data) |
376 | { | 378 | { |
377 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); | 379 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); |
378 | cmd.Parameters.AddWithValue("?uuid", uuid.ToString()); | 380 | cmd.Parameters.AddWithValue("?uuid", uuid.ToString()); |
@@ -395,7 +397,7 @@ namespace OpenSim.Data.MySQL | |||
395 | 397 | ||
396 | IDataReader r = cmd.ExecuteReader(); | 398 | IDataReader r = cmd.ExecuteReader(); |
397 | 399 | ||
398 | while(r.Read()) | 400 | while (r.Read()) |
399 | { | 401 | { |
400 | // EstateBan eb = new EstateBan(); | 402 | // EstateBan eb = new EstateBan(); |
401 | 403 | ||
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 823b81b..99de5cd 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Data.SQLite | |||
94 | /// <returns>Asset base</returns> | 94 | /// <returns>Asset base</returns> |
95 | override public AssetBase FetchAsset(LLUUID uuid) | 95 | override public AssetBase FetchAsset(LLUUID uuid) |
96 | { | 96 | { |
97 | lock(this) | 97 | lock (this) |
98 | { | 98 | { |
99 | using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) | 99 | using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) |
100 | { | 100 | { |
@@ -130,7 +130,8 @@ namespace OpenSim.Data.SQLite | |||
130 | } | 130 | } |
131 | else | 131 | else |
132 | { | 132 | { |
133 | lock(this) { | 133 | lock (this) |
134 | { | ||
134 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) | 135 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) |
135 | { | 136 | { |
136 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); | 137 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); |
@@ -155,7 +156,8 @@ namespace OpenSim.Data.SQLite | |||
155 | { | 156 | { |
156 | LogAssetLoad(asset); | 157 | LogAssetLoad(asset); |
157 | 158 | ||
158 | lock(this) { | 159 | lock (this) |
160 | { | ||
159 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) | 161 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) |
160 | { | 162 | { |
161 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); | 163 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); |
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index db85239..93d86b6 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Data.SQLite | |||
74 | BindingFlags.DeclaredOnly); | 74 | BindingFlags.DeclaredOnly); |
75 | 75 | ||
76 | foreach (FieldInfo f in m_Fields) | 76 | foreach (FieldInfo f in m_Fields) |
77 | if(f.Name.Substring(0, 2) == "m_") | 77 | if (f.Name.Substring(0, 2) == "m_") |
78 | m_FieldMap[f.Name.Substring(2)] = f; | 78 | m_FieldMap[f.Name.Substring(2)] = f; |
79 | } | 79 | } |
80 | 80 | ||
@@ -97,14 +97,14 @@ namespace OpenSim.Data.SQLite | |||
97 | 97 | ||
98 | IDataReader r = cmd.ExecuteReader(); | 98 | IDataReader r = cmd.ExecuteReader(); |
99 | 99 | ||
100 | if(r.Read()) | 100 | if (r.Read()) |
101 | { | 101 | { |
102 | foreach (string name in FieldList) | 102 | foreach (string name in FieldList) |
103 | { | 103 | { |
104 | if(m_FieldMap[name].GetValue(es) is bool) | 104 | if (m_FieldMap[name].GetValue(es) is bool) |
105 | { | 105 | { |
106 | int v = Convert.ToInt32(r[name]); | 106 | int v = Convert.ToInt32(r[name]); |
107 | if(v != 0) | 107 | if (v != 0) |
108 | m_FieldMap[name].SetValue(es, true); | 108 | m_FieldMap[name].SetValue(es, true); |
109 | else | 109 | else |
110 | m_FieldMap[name].SetValue(es, false); | 110 | m_FieldMap[name].SetValue(es, false); |
@@ -133,9 +133,9 @@ namespace OpenSim.Data.SQLite | |||
133 | 133 | ||
134 | foreach (string name in FieldList) | 134 | foreach (string name in FieldList) |
135 | { | 135 | { |
136 | if(m_FieldMap[name].GetValue(es) is bool) | 136 | if (m_FieldMap[name].GetValue(es) is bool) |
137 | { | 137 | { |
138 | if((bool)m_FieldMap[name].GetValue(es)) | 138 | if ((bool)m_FieldMap[name].GetValue(es)) |
139 | cmd.Parameters.Add(":"+name, "1"); | 139 | cmd.Parameters.Add(":"+name, "1"); |
140 | else | 140 | else |
141 | cmd.Parameters.Add(":"+name, "0"); | 141 | cmd.Parameters.Add(":"+name, "0"); |
@@ -215,9 +215,9 @@ namespace OpenSim.Data.SQLite | |||
215 | 215 | ||
216 | foreach (string name in FieldList) | 216 | foreach (string name in FieldList) |
217 | { | 217 | { |
218 | if(m_FieldMap[name].GetValue(es) is bool) | 218 | if (m_FieldMap[name].GetValue(es) is bool) |
219 | { | 219 | { |
220 | if((bool)m_FieldMap[name].GetValue(es)) | 220 | if ((bool)m_FieldMap[name].GetValue(es)) |
221 | cmd.Parameters.Add(":"+name, "1"); | 221 | cmd.Parameters.Add(":"+name, "1"); |
222 | else | 222 | else |
223 | cmd.Parameters.Add(":"+name, "0"); | 223 | cmd.Parameters.Add(":"+name, "0"); |
@@ -247,7 +247,7 @@ namespace OpenSim.Data.SQLite | |||
247 | 247 | ||
248 | IDataReader r = cmd.ExecuteReader(); | 248 | IDataReader r = cmd.ExecuteReader(); |
249 | 249 | ||
250 | while(r.Read()) | 250 | while (r.Read()) |
251 | { | 251 | { |
252 | EstateBan eb = new EstateBan(); | 252 | EstateBan eb = new EstateBan(); |
253 | 253 | ||
@@ -275,7 +275,7 @@ namespace OpenSim.Data.SQLite | |||
275 | 275 | ||
276 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; | 276 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; |
277 | 277 | ||
278 | foreach(EstateBan b in es.EstateBans) | 278 | foreach (EstateBan b in es.EstateBans) |
279 | { | 279 | { |
280 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); | 280 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); |
281 | cmd.Parameters.Add(":bannedUUID", b.bannedUUID.ToString()); | 281 | cmd.Parameters.Add(":bannedUUID", b.bannedUUID.ToString()); |
@@ -298,7 +298,7 @@ namespace OpenSim.Data.SQLite | |||
298 | 298 | ||
299 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; | 299 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; |
300 | 300 | ||
301 | foreach(LLUUID uuid in data) | 301 | foreach (LLUUID uuid in data) |
302 | { | 302 | { |
303 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); | 303 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); |
304 | cmd.Parameters.Add(":uuid", uuid.ToString()); | 304 | cmd.Parameters.Add(":uuid", uuid.ToString()); |
@@ -319,7 +319,7 @@ namespace OpenSim.Data.SQLite | |||
319 | 319 | ||
320 | IDataReader r = cmd.ExecuteReader(); | 320 | IDataReader r = cmd.ExecuteReader(); |
321 | 321 | ||
322 | while(r.Read()) | 322 | while (r.Read()) |
323 | { | 323 | { |
324 | // EstateBan eb = new EstateBan(); | 324 | // EstateBan eb = new EstateBan(); |
325 | 325 | ||