diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 25 |
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 | } |