diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLSimulationData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index e754522..3db30d8 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -189,7 +189,7 @@ namespace OpenSim.Data.MySQL | |||
189 | "AttachedPosY, AttachedPosZ, " + | 189 | "AttachedPosY, AttachedPosZ, " + |
190 | "PhysicsShapeType, Density, GravityModifier, " + | 190 | "PhysicsShapeType, Density, GravityModifier, " + |
191 | "Friction, Restitution, Vehicle, PhysInertia, DynAttrs, " + | 191 | "Friction, Restitution, Vehicle, PhysInertia, DynAttrs, " + |
192 | "RotationAxisLocks" + | 192 | "RotationAxisLocks, sopanims" + |
193 | ") values (" + "?UUID, " + | 193 | ") values (" + "?UUID, " + |
194 | "?CreationDate, ?Name, ?Text, " + | 194 | "?CreationDate, ?Name, ?Text, " + |
195 | "?Description, ?SitName, ?TouchName, " + | 195 | "?Description, ?SitName, ?TouchName, " + |
@@ -226,7 +226,7 @@ namespace OpenSim.Data.MySQL | |||
226 | "?AttachedPosY, ?AttachedPosZ, " + | 226 | "?AttachedPosY, ?AttachedPosZ, " + |
227 | "?PhysicsShapeType, ?Density, ?GravityModifier, " + | 227 | "?PhysicsShapeType, ?Density, ?GravityModifier, " + |
228 | "?Friction, ?Restitution, ?Vehicle, ?PhysInertia, ?DynAttrs," + | 228 | "?Friction, ?Restitution, ?Vehicle, ?PhysInertia, ?DynAttrs," + |
229 | "?RotationAxisLocks)"; | 229 | "?RotationAxisLocks, ?sopanims)"; |
230 | 230 | ||
231 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); | 231 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); |
232 | 232 | ||
@@ -598,7 +598,7 @@ namespace OpenSim.Data.MySQL | |||
598 | // Legacy entry point for when terrain was always a 256x256 hieghtmap | 598 | // Legacy entry point for when terrain was always a 256x256 hieghtmap |
599 | public void StoreTerrain(double[,] ter, UUID regionID) | 599 | public void StoreTerrain(double[,] ter, UUID regionID) |
600 | { | 600 | { |
601 | StoreTerrain(new HeightmapTerrainData(ter), regionID); | 601 | StoreTerrain(new TerrainData(ter), regionID); |
602 | } | 602 | } |
603 | 603 | ||
604 | public void StoreTerrain(TerrainData terrData, UUID regionID) | 604 | public void StoreTerrain(TerrainData terrData, UUID regionID) |
@@ -1403,7 +1403,10 @@ namespace OpenSim.Data.MySQL | |||
1403 | 1403 | ||
1404 | prim.Sound = DBGuid.FromDB(row["LoopedSound"].ToString()); | 1404 | prim.Sound = DBGuid.FromDB(row["LoopedSound"].ToString()); |
1405 | prim.SoundGain = (float)(double)row["LoopedSoundGain"]; | 1405 | prim.SoundGain = (float)(double)row["LoopedSoundGain"]; |
1406 | prim.SoundFlags = 1; // If it's persisted at all, it's looped | 1406 | if (prim.Sound != UUID.Zero) |
1407 | prim.SoundFlags = 1; // If it's persisted at all, it's looped | ||
1408 | else | ||
1409 | prim.SoundFlags = 0; | ||
1407 | 1410 | ||
1408 | if (!(row["TextureAnimation"] is DBNull)) | 1411 | if (!(row["TextureAnimation"] is DBNull)) |
1409 | prim.TextureAnimation = (byte[])row["TextureAnimation"]; | 1412 | prim.TextureAnimation = (byte[])row["TextureAnimation"]; |
@@ -1463,7 +1466,7 @@ namespace OpenSim.Data.MySQL | |||
1463 | if (!(row["DynAttrs"] is System.DBNull)) | 1466 | if (!(row["DynAttrs"] is System.DBNull)) |
1464 | prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); | 1467 | prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); |
1465 | else | 1468 | else |
1466 | prim.DynAttrs = new DAMap(); | 1469 | prim.DynAttrs = null; |
1467 | 1470 | ||
1468 | if (!(row["KeyframeMotion"] is DBNull)) | 1471 | if (!(row["KeyframeMotion"] is DBNull)) |
1469 | { | 1472 | { |
@@ -1499,6 +1502,19 @@ namespace OpenSim.Data.MySQL | |||
1499 | pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString()); | 1502 | pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString()); |
1500 | prim.PhysicsInertia = pdata; | 1503 | prim.PhysicsInertia = pdata; |
1501 | 1504 | ||
1505 | if (!(row["sopanims"] is DBNull)) | ||
1506 | { | ||
1507 | Byte[] data = (byte[])row["sopanims"]; | ||
1508 | if (data.Length > 0) | ||
1509 | prim.DeSerializeAnimations(data); | ||
1510 | else | ||
1511 | prim.Animations = null; | ||
1512 | } | ||
1513 | else | ||
1514 | { | ||
1515 | prim.Animations = null; | ||
1516 | } | ||
1517 | |||
1502 | return prim; | 1518 | return prim; |
1503 | } | 1519 | } |
1504 | 1520 | ||
@@ -1867,7 +1883,7 @@ namespace OpenSim.Data.MySQL | |||
1867 | else | 1883 | else |
1868 | cmd.Parameters.AddWithValue("Vehicle", String.Empty); | 1884 | cmd.Parameters.AddWithValue("Vehicle", String.Empty); |
1869 | 1885 | ||
1870 | if (prim.DynAttrs.CountNamespaces > 0) | 1886 | if (prim.DynAttrs != null && prim.DynAttrs.CountNamespaces > 0) |
1871 | cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); | 1887 | cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); |
1872 | else | 1888 | else |
1873 | cmd.Parameters.AddWithValue("DynAttrs", null); | 1889 | cmd.Parameters.AddWithValue("DynAttrs", null); |
@@ -1878,6 +1894,11 @@ namespace OpenSim.Data.MySQL | |||
1878 | cmd.Parameters.AddWithValue("Friction", (double)prim.Friction); | 1894 | cmd.Parameters.AddWithValue("Friction", (double)prim.Friction); |
1879 | cmd.Parameters.AddWithValue("Restitution", (double)prim.Restitution); | 1895 | cmd.Parameters.AddWithValue("Restitution", (double)prim.Restitution); |
1880 | cmd.Parameters.AddWithValue("RotationAxisLocks", prim.RotationAxisLocks); | 1896 | cmd.Parameters.AddWithValue("RotationAxisLocks", prim.RotationAxisLocks); |
1897 | |||
1898 | if (prim.Animations!= null) | ||
1899 | cmd.Parameters.AddWithValue("sopanims", prim.SerializeAnimations()); | ||
1900 | else | ||
1901 | cmd.Parameters.AddWithValue("sopanims", null); | ||
1881 | } | 1902 | } |
1882 | 1903 | ||
1883 | /// <summary> | 1904 | /// <summary> |