aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteSimulationData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs40
1 files changed, 39 insertions, 1 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 76f717d..4d6a80a 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -1236,6 +1236,10 @@ namespace OpenSim.Data.SQLite
1236 1236
1237 createCol(prims, "MediaURL", typeof(String)); 1237 createCol(prims, "MediaURL", typeof(String));
1238 1238
1239 createCol(prims, "AttachedPosX", typeof(Double));
1240 createCol(prims, "AttachedPosY", typeof(Double));
1241 createCol(prims, "AttachedPosZ", typeof(Double));
1242
1239 createCol(prims, "DynAttrs", typeof(String)); 1243 createCol(prims, "DynAttrs", typeof(String));
1240 1244
1241 createCol(prims, "PhysicsShapeType", typeof(Byte)); 1245 createCol(prims, "PhysicsShapeType", typeof(Byte));
@@ -1244,6 +1248,7 @@ namespace OpenSim.Data.SQLite
1244 createCol(prims, "Friction", typeof(Double)); 1248 createCol(prims, "Friction", typeof(Double));
1245 createCol(prims, "Restitution", typeof(Double)); 1249 createCol(prims, "Restitution", typeof(Double));
1246 1250
1251 createCol(prims, "KeyframeMotion", typeof(Byte[]));
1247 // Add in contraints 1252 // Add in contraints
1248 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; 1253 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };
1249 1254
@@ -1723,6 +1728,12 @@ namespace OpenSim.Data.SQLite
1723 prim.MediaUrl = (string)row["MediaURL"]; 1728 prim.MediaUrl = (string)row["MediaURL"];
1724 } 1729 }
1725 1730
1731 prim.AttachedPos = new Vector3(
1732 Convert.ToSingle(row["AttachedPosX"]),
1733 Convert.ToSingle(row["AttachedPosY"]),
1734 Convert.ToSingle(row["AttachedPosZ"])
1735 );
1736
1726 if (!(row["DynAttrs"] is System.DBNull)) 1737 if (!(row["DynAttrs"] is System.DBNull))
1727 { 1738 {
1728 //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); 1739 //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType());
@@ -1739,6 +1750,20 @@ namespace OpenSim.Data.SQLite
1739 prim.Friction = Convert.ToSingle(row["Friction"]); 1750 prim.Friction = Convert.ToSingle(row["Friction"]);
1740 prim.Restitution = Convert.ToSingle(row["Restitution"]); 1751 prim.Restitution = Convert.ToSingle(row["Restitution"]);
1741 1752
1753
1754 if (!(row["KeyframeMotion"] is DBNull))
1755 {
1756 Byte[] data = (byte[])row["KeyframeMotion"];
1757 if (data.Length > 0)
1758 prim.KeyframeMotion = KeyframeMotion.FromData(null, data);
1759 else
1760 prim.KeyframeMotion = null;
1761 }
1762 else
1763 {
1764 prim.KeyframeMotion = null;
1765 }
1766
1742 return prim; 1767 return prim;
1743 } 1768 }
1744 1769
@@ -2161,7 +2186,11 @@ namespace OpenSim.Data.SQLite
2161 2186
2162 row["MediaURL"] = prim.MediaUrl; 2187 row["MediaURL"] = prim.MediaUrl;
2163 2188
2164 if (prim.DynAttrs.Count > 0) 2189 row["AttachedPosX"] = prim.AttachedPos.X;
2190 row["AttachedPosY"] = prim.AttachedPos.Y;
2191 row["AttachedPosZ"] = prim.AttachedPos.Z;
2192
2193 if (prim.DynAttrs.CountNamespaces > 0)
2165 row["DynAttrs"] = prim.DynAttrs.ToXml(); 2194 row["DynAttrs"] = prim.DynAttrs.ToXml();
2166 else 2195 else
2167 row["DynAttrs"] = null; 2196 row["DynAttrs"] = null;
@@ -2171,6 +2200,13 @@ namespace OpenSim.Data.SQLite
2171 row["GravityModifier"] = (double)prim.GravityModifier; 2200 row["GravityModifier"] = (double)prim.GravityModifier;
2172 row["Friction"] = (double)prim.Friction; 2201 row["Friction"] = (double)prim.Friction;
2173 row["Restitution"] = (double)prim.Restitution; 2202 row["Restitution"] = (double)prim.Restitution;
2203
2204 if (prim.KeyframeMotion != null)
2205 row["KeyframeMotion"] = prim.KeyframeMotion.Serialize();
2206 else
2207 row["KeyframeMotion"] = new Byte[0];
2208
2209
2174 } 2210 }
2175 2211
2176 /// <summary> 2212 /// <summary>
@@ -2422,6 +2458,7 @@ namespace OpenSim.Data.SQLite
2422 s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); 2458 s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]);
2423 s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); 2459 s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]);
2424 s.State = Convert.ToByte(row["State"]); 2460 s.State = Convert.ToByte(row["State"]);
2461 s.LastAttachPoint = Convert.ToByte(row["LastAttachPoint"]);
2425 2462
2426 byte[] textureEntry = (byte[])row["Texture"]; 2463 byte[] textureEntry = (byte[])row["Texture"];
2427 s.TextureEntry = textureEntry; 2464 s.TextureEntry = textureEntry;
@@ -2471,6 +2508,7 @@ namespace OpenSim.Data.SQLite
2471 row["ProfileCurve"] = s.ProfileCurve; 2508 row["ProfileCurve"] = s.ProfileCurve;
2472 row["ProfileHollow"] = s.ProfileHollow; 2509 row["ProfileHollow"] = s.ProfileHollow;
2473 row["State"] = s.State; 2510 row["State"] = s.State;
2511 row["LastAttachPoint"] = s.LastAttachPoint;
2474 2512
2475 row["Texture"] = s.TextureEntry; 2513 row["Texture"] = s.TextureEntry;
2476 row["ExtraParams"] = s.ExtraParams; 2514 row["ExtraParams"] = s.ExtraParams;