aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL/PGSQLSimulationData.cs')
-rw-r--r--OpenSim/Data/PGSQL/PGSQLSimulationData.cs39
1 files changed, 26 insertions, 13 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
index f4af40b..99ceb91 100644
--- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
@@ -353,7 +353,7 @@ namespace OpenSim.Data.PGSQL
353 ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution, 353 ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution,
354 ""PassCollisions"" = :PassCollisions, ""RotationAxisLocks"" = :RotationAxisLocks, ""RezzerID"" = :RezzerID, 354 ""PassCollisions"" = :PassCollisions, ""RotationAxisLocks"" = :RotationAxisLocks, ""RezzerID"" = :RezzerID,
355 ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches, 355 ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
356 ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, 356 ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, ""Vehicle"" = :Vehicle,
357 ""PhysInertia"" = :PhysInertia 357 ""PhysInertia"" = :PhysInertia
358 WHERE ""UUID"" = :UUID ; 358 WHERE ""UUID"" = :UUID ;
359 359
@@ -368,7 +368,7 @@ namespace OpenSim.Data.PGSQL
368 ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"", 368 ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"",
369 ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"", 369 ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
370 ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"", 370 ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
371 ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID"" , ""PhysInertia"" 371 ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID"" , ""Vehicle"", ""PhysInertia""
372 ) Select 372 ) Select
373 :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask, 373 :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
374 :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX, 374 :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
@@ -379,7 +379,7 @@ namespace OpenSim.Data.PGSQL
379 :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ, 379 :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ,
380 :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA, 380 :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
381 :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs, 381 :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
382 :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID, :PhysInertia 382 :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID, :Vehicle, :PhysInertia
383 where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID); 383 where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID);
384 "; 384 ";
385 385
@@ -610,7 +610,7 @@ namespace OpenSim.Data.PGSQL
610 // Legacy entry point for when terrain was always a 256x256 heightmap 610 // Legacy entry point for when terrain was always a 256x256 heightmap
611 public void StoreTerrain(double[,] terrain, UUID regionID) 611 public void StoreTerrain(double[,] terrain, UUID regionID)
612 { 612 {
613 StoreTerrain(new HeightmapTerrainData(terrain), regionID); 613 StoreTerrain(new TerrainData(terrain), regionID);
614 } 614 }
615 615
616 /// <summary> 616 /// <summary>
@@ -1742,7 +1742,10 @@ namespace OpenSim.Data.PGSQL
1742 1742
1743 prim.Sound = new UUID((Guid)primRow["LoopedSound"]); 1743 prim.Sound = new UUID((Guid)primRow["LoopedSound"]);
1744 prim.SoundGain = Convert.ToSingle(primRow["LoopedSoundGain"]); 1744 prim.SoundGain = Convert.ToSingle(primRow["LoopedSoundGain"]);
1745 prim.SoundFlags = 1; // If it's persisted at all, it's looped 1745 if (prim.Sound != UUID.Zero)
1746 prim.SoundFlags = 1; // If it's persisted at all, it's looped
1747 else
1748 prim.SoundFlags = 0;
1746 1749
1747 if (!(primRow["TextureAnimation"] is DBNull)) 1750 if (!(primRow["TextureAnimation"] is DBNull))
1748 prim.TextureAnimation = (Byte[])primRow["TextureAnimation"]; 1751 prim.TextureAnimation = (Byte[])primRow["TextureAnimation"];
@@ -1797,7 +1800,7 @@ namespace OpenSim.Data.PGSQL
1797 if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "") 1800 if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "")
1798 prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]); 1801 prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]);
1799 else 1802 else
1800 prim.DynAttrs = new DAMap(); 1803 prim.DynAttrs = null;
1801 1804
1802 prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]); 1805 prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]);
1803 prim.Density = Convert.ToSingle(primRow["Density"]); 1806 prim.Density = Convert.ToSingle(primRow["Density"]);
@@ -1805,8 +1808,15 @@ namespace OpenSim.Data.PGSQL
1805 prim.Friction = Convert.ToSingle(primRow["Friction"]); 1808 prim.Friction = Convert.ToSingle(primRow["Friction"]);
1806 prim.Restitution = Convert.ToSingle(primRow["Restitution"]); 1809 prim.Restitution = Convert.ToSingle(primRow["Restitution"]);
1807 prim.RotationAxisLocks = Convert.ToByte(primRow["RotationAxisLocks"]); 1810 prim.RotationAxisLocks = Convert.ToByte(primRow["RotationAxisLocks"]);
1808 1811
1809 1812 SOPVehicle vehicle = null;
1813 if (!(primRow["Vehicle"] is System.DBNull))
1814 {
1815 vehicle = SOPVehicle.FromXml2(primRow["Vehicle"].ToString());
1816 if (vehicle != null)
1817 prim.VehicleParams = vehicle;
1818 }
1819
1810 PhysicsInertiaData pdata = null; 1820 PhysicsInertiaData pdata = null;
1811 if (!(primRow["PhysInertia"] is System.DBNull)) 1821 if (!(primRow["PhysInertia"] is System.DBNull))
1812 pdata = PhysicsInertiaData.FromXml2(primRow["PhysInertia"].ToString()); 1822 pdata = PhysicsInertiaData.FromXml2(primRow["PhysInertia"].ToString());
@@ -2214,8 +2224,7 @@ namespace OpenSim.Data.PGSQL
2214 2224
2215 parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches)); 2225 parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches));
2216 parameters.Add(_Database.CreateParameter("PassCollisions", (bool)prim.PassCollisions)); 2226 parameters.Add(_Database.CreateParameter("PassCollisions", (bool)prim.PassCollisions));
2217 2227
2218
2219 if (prim.PassTouches) 2228 if (prim.PassTouches)
2220 parameters.Add(_Database.CreateParameter("PassTouches", true)); 2229 parameters.Add(_Database.CreateParameter("PassTouches", true));
2221 else 2230 else
@@ -2228,14 +2237,18 @@ namespace OpenSim.Data.PGSQL
2228 2237
2229 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); 2238 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
2230 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); 2239 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
2231 2240
2241 if (prim.VehicleParams != null)
2242 parameters.Add(_Database.CreateParameter("Vehicle", prim.VehicleParams.ToXml2()));
2243 else
2244 parameters.Add(_Database.CreateParameter("Vehicle", String.Empty));
2245
2232 if (prim.PhysicsInertia != null) 2246 if (prim.PhysicsInertia != null)
2233 parameters.Add(_Database.CreateParameter("PhysInertia", prim.PhysicsInertia.ToXml2())); 2247 parameters.Add(_Database.CreateParameter("PhysInertia", prim.PhysicsInertia.ToXml2()));
2234 else 2248 else
2235 parameters.Add(_Database.CreateParameter("PhysInertia", String.Empty)); 2249 parameters.Add(_Database.CreateParameter("PhysInertia", String.Empty));
2236 2250
2237 2251 if (prim.DynAttrs != null && prim.DynAttrs.CountNamespaces > 0)
2238 if (prim.DynAttrs.CountNamespaces > 0)
2239 parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); 2252 parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
2240 else 2253 else
2241 parameters.Add(_Database.CreateParameter("DynAttrs", null)); 2254 parameters.Add(_Database.CreateParameter("DynAttrs", null));