aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLEstateData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs24
1 files changed, 7 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index 08e2144..9158f7a 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -34,6 +34,7 @@ using MySql.Data.MySqlClient;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Data;
37 38
38namespace OpenSim.Data.MySQL 39namespace OpenSim.Data.MySQL
39{ 40{
@@ -156,20 +157,13 @@ namespace OpenSim.Data.MySQL
156 157
157 foreach (string name in FieldList) 158 foreach (string name in FieldList)
158 { 159 {
159 if (m_FieldMap[name].GetValue(es) is bool) 160 if (m_FieldMap[name].FieldType == typeof(bool))
160 { 161 {
161 int v = Convert.ToInt32(r[name]); 162 m_FieldMap[name].SetValue(es, Convert.ToInt32(r[name]) != 0);
162 if (v != 0)
163 m_FieldMap[name].SetValue(es, true);
164 else
165 m_FieldMap[name].SetValue(es, false);
166 } 163 }
167 else if (m_FieldMap[name].GetValue(es) is UUID) 164 else if (m_FieldMap[name].FieldType == typeof(UUID))
168 { 165 {
169 UUID uuid = UUID.Zero; 166 m_FieldMap[name].SetValue(es, DBGuid.FromDB(r[name]));
170
171 UUID.TryParse(r[name].ToString(), out uuid);
172 m_FieldMap[name].SetValue(es, uuid);
173 } 167 }
174 else 168 else
175 { 169 {
@@ -385,11 +379,7 @@ namespace OpenSim.Data.MySQL
385 while (r.Read()) 379 while (r.Read())
386 { 380 {
387 // EstateBan eb = new EstateBan(); 381 // EstateBan eb = new EstateBan();
388 382 uuids.Add(DBGuid.FromDB(r["uuid"]));
389 UUID uuid = new UUID();
390 UUID.TryParse(r["uuid"].ToString(), out uuid);
391
392 uuids.Add(uuid);
393 } 383 }
394 } 384 }
395 } 385 }
@@ -490,7 +480,7 @@ namespace OpenSim.Data.MySQL
490 using (IDataReader reader = cmd.ExecuteReader()) 480 using (IDataReader reader = cmd.ExecuteReader())
491 { 481 {
492 while(reader.Read()) 482 while(reader.Read())
493 result.Add(new UUID(reader["RegionID"].ToString())); 483 result.Add(DBGuid.FromDB(reader["RegionID"]));
494 reader.Close(); 484 reader.Close();
495 } 485 }
496 } 486 }