From 44993550a85f411e5ea88a889fb652744e2d3d1b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 1 Apr 2017 18:15:47 +0100 Subject: store the physics inertia override in SQlite --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 7 ++----- OpenSim/Data/SQLite/Resources/RegionStore.migrations | 6 ++++++ OpenSim/Data/SQLite/SQLiteSimulationData.cs | 11 +++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 97a433f..5740b91 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1452,13 +1452,10 @@ namespace OpenSim.Data.MySQL prim.VehicleParams = vehicle; } - PhysicsInertiaData pdata; + PhysicsInertiaData pdata = null; if (row["PhysInertia"].ToString() != String.Empty) - { pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString()); - if (pdata != null) - prim.PhysicsInertia = pdata; - } + prim.PhysicsInertia = pdata; return prim; } diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index eef14d6..fb154cf 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations @@ -371,3 +371,9 @@ BEGIN; ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL; COMMIT; + +:VERSION 36 #----- Add physics inertia data + +BEGIN; +ALTER TABLE `prims` ADD COLUMN `PhysInertia` TEXT default NULL; +COMMIT; diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index eec386f..19880de 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1843,6 +1843,12 @@ namespace OpenSim.Data.SQLite if (vehicle != null) prim.VehicleParams = vehicle; } + + PhysicsInertiaData pdata = null; + if (!(row["PhysInertia"] is DBNull) && row["PhysInertia"].ToString() != String.Empty) + pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString()); + prim.PhysicsInertia = pdata; + return prim; } @@ -2266,6 +2272,11 @@ namespace OpenSim.Data.SQLite else row["Vehicle"] = String.Empty; + if (prim.PhysicsInertia != null) + row["PhysInertia"] = prim.PhysicsInertia.ToXml2(); + else + row["PhysInertia"] = String.Empty; + } /// -- cgit v1.1