diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLEstateData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLEstateData.cs | 26 |
1 files changed, 14 insertions, 12 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 | ||