aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLRegionData.cs
diff options
context:
space:
mode:
authorKunnis2009-08-09 02:01:21 -0500
committerTeravus Ovares (Dan Olivares)2009-08-16 13:35:44 -0400
commit23d478f2fa06d1dedabfb24cf6ff763b586173ce (patch)
tree072fdcfe343d84cf01b0881045fc96fb8403c324 /OpenSim/Data/MySQL/MySQLRegionData.cs
parentAdd copyright header. Formatting cleanup. (diff)
downloadopensim-SC_OLD-23d478f2fa06d1dedabfb24cf6ff763b586173ce.zip
opensim-SC_OLD-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.gz
opensim-SC_OLD-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.bz2
opensim-SC_OLD-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.xz
Adding in Reflection-based testing, to ensure that all properties are covered.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 2166845..9c2ee4a 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -834,7 +834,10 @@ namespace OpenSim.Data.MySQL
834 // explicit conversion of integers is required, which sort 834 // explicit conversion of integers is required, which sort
835 // of sucks. No idea if there is a shortcut here or not. 835 // of sucks. No idea if there is a shortcut here or not.
836 prim.CreationDate = Convert.ToInt32(row["CreationDate"]); 836 prim.CreationDate = Convert.ToInt32(row["CreationDate"]);
837 prim.Name = (String) row["Name"]; 837 if (row["Name"] != DBNull.Value)
838 prim.Name = (String)row["Name"];
839 else
840 prim.Name = string.Empty;
838 // various text fields 841 // various text fields
839 prim.Text = (String) row["Text"]; 842 prim.Text = (String) row["Text"];
840 prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]), 843 prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]),
@@ -945,12 +948,12 @@ namespace OpenSim.Data.MySQL
945 prim.DIE_AT_EDGE = true; 948 prim.DIE_AT_EDGE = true;
946 949
947 prim.SalePrice = Convert.ToInt32(row["SalePrice"]); 950 prim.SalePrice = Convert.ToInt32(row["SalePrice"]);
948 prim.ObjectSaleType = Convert.ToByte(row["SaleType"]); 951 prim.ObjectSaleType = unchecked((byte)Convert.ToSByte(row["SaleType"]));
949 952
950 prim.Material = Convert.ToByte(row["Material"]); 953 prim.Material = unchecked((byte)Convert.ToSByte(row["Material"]));
951 954
952 if (!(row["ClickAction"] is DBNull)) 955 if (!(row["ClickAction"] is DBNull))
953 prim.ClickAction = (byte)Convert.ToByte(row["ClickAction"]); 956 prim.ClickAction = unchecked((byte)Convert.ToSByte(row["ClickAction"]));
954 957
955 prim.CollisionSound = new UUID(row["CollisionSound"].ToString()); 958 prim.CollisionSound = new UUID(row["CollisionSound"].ToString());
956 prim.CollisionSoundVolume = Convert.ToSingle(row["CollisionSoundVolume"]); 959 prim.CollisionSoundVolume = Convert.ToSingle(row["CollisionSoundVolume"]);
@@ -1277,12 +1280,12 @@ namespace OpenSim.Data.MySQL
1277 cmd.Parameters.AddWithValue("DieAtEdge", 0); 1280 cmd.Parameters.AddWithValue("DieAtEdge", 0);
1278 1281
1279 cmd.Parameters.AddWithValue("SalePrice", prim.SalePrice); 1282 cmd.Parameters.AddWithValue("SalePrice", prim.SalePrice);
1280 cmd.Parameters.AddWithValue("SaleType", Convert.ToInt16(prim.ObjectSaleType)); 1283 cmd.Parameters.AddWithValue("SaleType", unchecked((sbyte)(prim.ObjectSaleType)));
1281 1284
1282 byte clickAction = prim.ClickAction; 1285 byte clickAction = prim.ClickAction;
1283 cmd.Parameters.AddWithValue("ClickAction", clickAction); 1286 cmd.Parameters.AddWithValue("ClickAction", unchecked((sbyte)(clickAction)));
1284 1287
1285 cmd.Parameters.AddWithValue("Material", prim.Material); 1288 cmd.Parameters.AddWithValue("Material", unchecked((sbyte)(prim.Material)));
1286 1289
1287 cmd.Parameters.AddWithValue("CollisionSound", prim.CollisionSound.ToString()); 1290 cmd.Parameters.AddWithValue("CollisionSound", prim.CollisionSound.ToString());
1288 cmd.Parameters.AddWithValue("CollisionSoundVolume", prim.CollisionSoundVolume); 1291 cmd.Parameters.AddWithValue("CollisionSoundVolume", prim.CollisionSoundVolume);