aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
diff options
context:
space:
mode:
authorDiva Canto2011-04-28 07:28:29 -0700
committerDiva Canto2011-04-28 07:28:29 -0700
commit7ecf6895842eff93155e49d2f7fa4cd833510726 (patch)
tree76caa8db816b9b6d83dc945135e2a7f16c740d48 /OpenSim/Data/MSSQL/MSSQLSimulationData.cs
parentFix a bug where physical objects rezzed with an initial velocity by script do... (diff)
downloadopensim-SC_OLD-7ecf6895842eff93155e49d2f7fa4cd833510726.zip
opensim-SC_OLD-7ecf6895842eff93155e49d2f7fa4cd833510726.tar.gz
opensim-SC_OLD-7ecf6895842eff93155e49d2f7fa4cd833510726.tar.bz2
opensim-SC_OLD-7ecf6895842eff93155e49d2f7fa4cd833510726.tar.xz
Thank you MrMonkE for a patch that seems to bring the MSSQL data layer up to speed with 0.7.x.
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLSimulationData.cs')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLSimulationData.cs25
1 files changed, 18 insertions, 7 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
index 80ec65e..5155e56 100644
--- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
@@ -492,12 +492,11 @@ ELSE
492 using (SqlConnection conn = new SqlConnection(m_connectionString)) 492 using (SqlConnection conn = new SqlConnection(m_connectionString))
493 using (SqlCommand cmd = new SqlCommand(sql, conn)) 493 using (SqlCommand cmd = new SqlCommand(sql, conn))
494 { 494 {
495 conn.Open();
495 foreach (TaskInventoryItem taskItem in items) 496 foreach (TaskInventoryItem taskItem in items)
496 { 497 {
497 cmd.Parameters.AddRange(CreatePrimInventoryParameters(taskItem)); 498 cmd.Parameters.AddRange(CreatePrimInventoryParameters(taskItem));
498 conn.Open();
499 cmd.ExecuteNonQuery(); 499 cmd.ExecuteNonQuery();
500
501 cmd.Parameters.Clear(); 500 cmd.Parameters.Clear();
502 } 501 }
503 } 502 }
@@ -1154,9 +1153,9 @@ VALUES
1154 PrimitiveBaseShape baseShape = new PrimitiveBaseShape(); 1153 PrimitiveBaseShape baseShape = new PrimitiveBaseShape();
1155 1154
1156 baseShape.Scale = new Vector3( 1155 baseShape.Scale = new Vector3(
1157 Convert.ToSingle(shapeRow["ScaleX"]), 1156 (float)Convert.ToDouble(shapeRow["ScaleX"]),
1158 Convert.ToSingle(shapeRow["ScaleY"]), 1157 (float)Convert.ToDouble(shapeRow["ScaleY"]),
1159 Convert.ToSingle(shapeRow["ScaleZ"])); 1158 (float)Convert.ToDouble(shapeRow["ScaleZ"]));
1160 1159
1161 // paths 1160 // paths
1162 baseShape.PCode = Convert.ToByte(shapeRow["PCode"]); 1161 baseShape.PCode = Convert.ToByte(shapeRow["PCode"]);
@@ -1193,8 +1192,11 @@ VALUES
1193 { 1192 {
1194 } 1193 }
1195 1194
1196 if (!(shapeRow["Media"] is System.DBNull)) 1195 if (!(shapeRow["Media"] is System.DBNull) )
1196 {
1197 baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); 1197 baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]);
1198 }
1199
1198 1200
1199 return baseShape; 1201 return baseShape;
1200 } 1202 }
@@ -1573,7 +1575,16 @@ VALUES
1573 parameters.Add(_Database.CreateParameter("Texture", s.TextureEntry)); 1575 parameters.Add(_Database.CreateParameter("Texture", s.TextureEntry));
1574 parameters.Add(_Database.CreateParameter("ExtraParams", s.ExtraParams)); 1576 parameters.Add(_Database.CreateParameter("ExtraParams", s.ExtraParams));
1575 parameters.Add(_Database.CreateParameter("State", s.State)); 1577 parameters.Add(_Database.CreateParameter("State", s.State));
1576 parameters.Add(_Database.CreateParameter("Media", null == s.Media ? null : s.Media.ToXml())); 1578
1579 if(null == s.Media )
1580 {
1581 parameters.Add(_Database.CreateParameter("Media", DBNull.Value));
1582 }
1583 else
1584 {
1585 parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml()));
1586 }
1587
1577 1588
1578 return parameters.ToArray(); 1589 return parameters.ToArray();
1579 } 1590 }