aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLLegacyRegionData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLLegacyRegionData.cs85
1 files changed, 44 insertions, 41 deletions
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
index 801d6b9..a807948 100644
--- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
@@ -66,22 +66,26 @@ namespace OpenSim.Data.MySQL
66 Migration m = new Migration(m_Connection, assem, "RegionStore"); 66 Migration m = new Migration(m_Connection, assem, "RegionStore");
67 m.Update(); 67 m.Update();
68 68
69 // NOTE: This is a very slow query that times out on regions with a lot of prims.
70 // I'm told that it is no longer relevant so it's commented out now, but if it
71 // is relevant it should be added as a console command instead of part of the
72 // startup phase
69 // Clean dropped attachments 73 // Clean dropped attachments
70 // 74 //
71 try 75 //try
72 { 76 //{
73 using (MySqlCommand cmd = m_Connection.CreateCommand()) 77 // using (MySqlCommand cmd = m_Connection.CreateCommand())
74 { 78 // {
75 cmd.CommandText = "delete from prims, primshapes using prims " + 79 // cmd.CommandText = "delete from prims, primshapes using prims " +
76 "left join primshapes on prims.uuid = primshapes.uuid " + 80 // "left join primshapes on prims.uuid = primshapes.uuid " +
77 "where PCode = 9 and State <> 0"; 81 // "where PCode = 9 and State <> 0";
78 ExecuteNonQuery(cmd); 82 // ExecuteNonQuery(cmd);
79 } 83 // }
80 } 84 //}
81 catch (MySqlException ex) 85 //catch (MySqlException ex)
82 { 86 //{
83 m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message); 87 // m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
84 } 88 //}
85 } 89 }
86 90
87 private IDataReader ExecuteReader(MySqlCommand c) 91 private IDataReader ExecuteReader(MySqlCommand c)
@@ -1430,37 +1434,36 @@ namespace OpenSim.Data.MySQL
1430 { 1434 {
1431 PrimitiveBaseShape s = new PrimitiveBaseShape(); 1435 PrimitiveBaseShape s = new PrimitiveBaseShape();
1432 s.Scale = new Vector3( 1436 s.Scale = new Vector3(
1433 Convert.ToSingle(row["ScaleX"]), 1437 (float)(double)row["ScaleX"],
1434 Convert.ToSingle(row["ScaleY"]), 1438 (float)(double)row["ScaleY"],
1435 Convert.ToSingle(row["ScaleZ"]) 1439 (float)(double)row["ScaleZ"]
1436 ); 1440 );
1437 // paths 1441 // paths
1438 s.PCode = Convert.ToByte(row["PCode"]); 1442 s.PCode = (byte)(int)row["PCode"];
1439 s.PathBegin = Convert.ToUInt16(row["PathBegin"]); 1443 s.PathBegin = (ushort)(int)row["PathBegin"];
1440 s.PathEnd = Convert.ToUInt16(row["PathEnd"]); 1444 s.PathEnd = (ushort)(int)row["PathEnd"];
1441 s.PathScaleX = Convert.ToByte(row["PathScaleX"]); 1445 s.PathScaleX = (byte)(int)row["PathScaleX"];
1442 s.PathScaleY = Convert.ToByte(row["PathScaleY"]); 1446 s.PathScaleY = (byte)(int)row["PathScaleY"];
1443 s.PathShearX = Convert.ToByte(row["PathShearX"]); 1447 s.PathShearX = (byte)(int)row["PathShearX"];
1444 s.PathShearY = Convert.ToByte(row["PathShearY"]); 1448 s.PathShearY = (byte)(int)row["PathShearY"];
1445 s.PathSkew = Convert.ToSByte(row["PathSkew"]); 1449 s.PathSkew = (sbyte)(int)row["PathSkew"];
1446 s.PathCurve = Convert.ToByte(row["PathCurve"]); 1450 s.PathCurve = (byte)(int)row["PathCurve"];
1447 s.PathRadiusOffset = Convert.ToSByte(row["PathRadiusOffset"]); 1451 s.PathRadiusOffset = (sbyte)(int)row["PathRadiusOffset"];
1448 s.PathRevolutions = Convert.ToByte(row["PathRevolutions"]); 1452 s.PathRevolutions = (byte)(int)row["PathRevolutions"];
1449 s.PathTaperX = Convert.ToSByte(row["PathTaperX"]); 1453 s.PathTaperX = (sbyte)(int)row["PathTaperX"];
1450 s.PathTaperY = Convert.ToSByte(row["PathTaperY"]); 1454 s.PathTaperY = (sbyte)(int)row["PathTaperY"];
1451 s.PathTwist = Convert.ToSByte(row["PathTwist"]); 1455 s.PathTwist = (sbyte)(int)row["PathTwist"];
1452 s.PathTwistBegin = Convert.ToSByte(row["PathTwistBegin"]); 1456 s.PathTwistBegin = (sbyte)(int)row["PathTwistBegin"];
1453 // profile 1457 // profile
1454 s.ProfileBegin = Convert.ToUInt16(row["ProfileBegin"]); 1458 s.ProfileBegin = (ushort)(int)row["ProfileBegin"];
1455 s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]); 1459 s.ProfileEnd = (ushort)(int)row["ProfileEnd"];
1456 s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); 1460 s.ProfileCurve = (byte)(int)row["ProfileCurve"];
1457 s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); 1461 s.ProfileHollow = (ushort)(int)row["ProfileHollow"];
1458 byte[] textureEntry = (byte[]) row["Texture"]; 1462 s.TextureEntry = (byte[])row["Texture"];
1459 s.TextureEntry = textureEntry;
1460 1463
1461 s.ExtraParams = (byte[]) row["ExtraParams"]; 1464 s.ExtraParams = (byte[])row["ExtraParams"];
1462 1465
1463 s.State = Convert.ToByte(row["State"]); 1466 s.State = (byte)(int)row["State"];
1464 1467
1465 return s; 1468 return s;
1466 } 1469 }