From 650cef67d184e3f7752d56f710bf58f82b381be3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Dec 2018 18:44:33 +0000 Subject: [PATCH] PGSQL: store vehicle data --- OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index f4af40ba88..fa8bb302a1 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -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