From 0958eceadda4330fdd35d5b979eb28d035b25797 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 28 Mar 2020 01:31:00 +0000 Subject: [PATCH] store sop pseudocrc and region cacheID on PGSQL ( others later) --- OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 18 ++++++++++++++---- .../PGSQL/Resources/RegionStore.migrations | 8 ++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index c683797012..dd2ad449c0 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -355,7 +355,7 @@ namespace OpenSim.Data.PGSQL ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches, ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, ""Vehicle"" = :Vehicle, ""PhysInertia"" = :PhysInertia, ""standtargetx"" =:standtargetx, ""standtargety"" =:standtargety, ""standtargetz"" =:standtargetz, - ""sitactrange"" =:sitactrange + ""sitactrange"" =:sitactrange, ""pseudocrc"" = :pseudocrc WHERE ""UUID"" = :UUID ; @@ -371,7 +371,7 @@ namespace OpenSim.Data.PGSQL ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"", ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"", ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID"" , ""Vehicle"", ""PhysInertia"", - ""standtargetx"", ""standtargety"", ""standtargetz"", ""sitactrange"" + ""standtargetx"", ""standtargety"", ""standtargetz"", ""sitactrange"", ""pseudocrc"" ) Select :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask, :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX, @@ -383,7 +383,7 @@ namespace OpenSim.Data.PGSQL :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA, :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs, :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID, :Vehicle, :PhysInertia, - :standtargetx, :standtargety, :standtargetz,:sitactrange + :standtargetx, :standtargety, :standtargetz,:sitactrange, :pseudocrc where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID); "; @@ -1436,7 +1436,7 @@ namespace OpenSim.Data.PGSQL ,terrain_lower_limit = :terrain_lower_limit ,use_estate_sun = :use_estate_sun ,fixed_sun = :fixed_sun ,sun_position = :sun_position ,covenant = :covenant ,covenant_datetime = :covenant_datetime, sunvectorx = :sunvectorx, sunvectory = :sunvectory, sunvectorz = :sunvectorz, ""Sandbox"" = :Sandbox, loaded_creation_datetime = :loaded_creation_datetime, loaded_creation_id = :loaded_creation_id, ""map_tile_ID"" = :TerrainImageID, -""TelehubObject"" = :telehubobject, ""parcel_tile_ID"" = :ParcelImageID +""TelehubObject"" = :telehubobject, ""parcel_tile_ID"" = :ParcelImageID, ""cacheID"" = :cacheID WHERE ""regionUUID"" = :regionUUID"; using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) @@ -1551,6 +1551,8 @@ namespace OpenSim.Data.PGSQL newSettings.ParcelImageID = new UUID((Guid)row["parcel_tile_ID"]); newSettings.TelehubObject = new UUID((Guid)row["TelehubObject"]); + if (!(row["cacheID"] is DBNull)) + newSettings.CacheID = new UUID((Guid)row["cacheID"]); return newSettings; } @@ -1834,6 +1836,10 @@ namespace OpenSim.Data.PGSQL pdata = PhysicsInertiaData.FromXml2(primRow["PhysInertia"].ToString()); prim.PhysicsInertia = pdata; + int pseudocrc = Convert.ToInt32(primRow["pseudocrc"]); + if(pseudocrc != 0) + prim.PseudoCRC = pseudocrc; + return prim; } @@ -2020,6 +2026,8 @@ namespace OpenSim.Data.PGSQL parameters.Add(_Database.CreateParameter("ParcelImageID", settings.ParcelImageID)); parameters.Add(_Database.CreateParameter("TelehubObject", settings.TelehubObject)); + parameters.Add(_Database.CreateParameter("cacheID", settings.CacheID)); + return parameters.ToArray(); } @@ -2279,6 +2287,8 @@ namespace OpenSim.Data.PGSQL parameters.Add(_Database.CreateParameter("Restitution", (double)prim.Restitution)); parameters.Add(_Database.CreateParameter("RotationAxisLocks", prim.RotationAxisLocks)); + parameters.Add(_Database.CreateParameter("pseudocrc", prim.PseudoCRC)); + return parameters.ToArray(); } diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations index e0e788f73d..1332cb8b15 100644 --- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations @@ -1242,3 +1242,11 @@ ADD COLUMN `standtargety` real DEFAULT '0.0', ADD COLUMN `standtargetz` real DEFAULT '0.0', ADD COLUMN `sitactrange` real DEFAULT '0.0'; COMMIT; + + +:VERSION 50 #----- Add pseudo CRC and region cache id + +BEGIN; +ALTER TABLE `prims` ADD COLUMN `pseudocrc` integer DEFAULT '0'; +ALTER TABLE `regionsettings` ADD COLUMN `cacheID` uuid DEFAULT NULL; +COMMIT;