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

@ -1806,6 +1806,13 @@ namespace OpenSim.Data.PGSQL
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))
@ -2215,7 +2222,6 @@ 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
@ -2229,12 +2235,16 @@ 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