PGSQL: store vehicle data

0.9.1.0-post-fixes
UbitUmarov 2018-12-28 18:44:33 +00:00
parent c14209e362
commit 650cef67d1
1 changed files with 16 additions and 6 deletions

View File

@ -1805,8 +1805,15 @@ namespace OpenSim.Data.PGSQL
prim.Friction = Convert.ToSingle(primRow["Friction"]);
prim.Restitution = Convert.ToSingle(primRow["Restitution"]);
prim.RotationAxisLocks = Convert.ToByte(primRow["RotationAxisLocks"]);
SOPVehicle vehicle = null;
if (!(primRow["Vehicle"] is System.DBNull))
{
vehicle = SOPVehicle.FromXml2(primRow["Vehicle"].ToString());
if (vehicle != null)
prim.VehicleParams = vehicle;
}
PhysicsInertiaData pdata = null;
if (!(primRow["PhysInertia"] is System.DBNull))
pdata = PhysicsInertiaData.FromXml2(primRow["PhysInertia"].ToString());
@ -2214,8 +2221,7 @@ namespace OpenSim.Data.PGSQL
parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches));
parameters.Add(_Database.CreateParameter("PassCollisions", (bool)prim.PassCollisions));
if (prim.PassTouches)
parameters.Add(_Database.CreateParameter("PassTouches", true));
else
@ -2228,13 +2234,17 @@ namespace OpenSim.Data.PGSQL
parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
if (prim.VehicleParams != null)
parameters.Add(_Database.CreateParameter("Vehicle", prim.VehicleParams.ToXml2()));
else
parameters.Add(_Database.CreateParameter("Vehicle", String.Empty));
if (prim.PhysicsInertia != null)
parameters.Add(_Database.CreateParameter("PhysInertia", prim.PhysicsInertia.ToXml2()));
else
parameters.Add(_Database.CreateParameter("PhysInertia", String.Empty));
if (prim.DynAttrs.CountNamespaces > 0)
parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
else