From 60da45b71512e775fd7146e1bd3b653ef2685d70 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 23 Jun 2020 14:28:34 +0100 Subject: [PATCH] lang env on sqlite --- .../SQLite/Resources/RegionStore.migrations | 21 +++++---- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 45 +++++++++++++++++++ .../Avatar/Attachments/AttachmentsModule.cs | 2 +- .../World/LightShare/EnvironmentModule.cs | 12 ++--- 4 files changed, 66 insertions(+), 14 deletions(-) diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index 3cc02c1429..3de115df83 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations @@ -183,14 +183,14 @@ CREATE TABLE IF NOT EXISTS land( UserLookAtY float, UserLookAtZ float, AuthbuyerID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000', - OtherCleanTime INTEGER NOT NULL default 0, - Dwell INTEGER NOT NULL default 0, - `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none', - `MediaDescription` VARCHAR(255) NOT NULL DEFAULT '', - `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0', - `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE, - `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE, - `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE); + OtherCleanTime INTEGER NOT NULL default 0, + Dwell INTEGER NOT NULL default 0, + `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none', + `MediaDescription` VARCHAR(255) NOT NULL DEFAULT '', + `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0', + MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE, + `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE, + `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE); CREATE TABLE IF NOT EXISTS landaccesslist( LandUUID varchar(255), @@ -394,3 +394,8 @@ BEGIN; ALTER TABLE `prims` ADD COLUMN `pseudocrc` integer DEFAULT '0'; ALTER TABLE `regionsettings` ADD COLUMN `cacheID` char(36) DEFAULT NULL; COMMIT; + +:VERSION 39 #----- parcel environment store +BEGIN; +ALTER TABLE `land` ADD COLUMN `environment` TEXT default NULL; +COMMIT; diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index c51e1c7464..0d5256bb76 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1399,6 +1399,7 @@ namespace OpenSim.Data.SQLite createCol(land, "SeeAVs", typeof(Boolean)); createCol(land, "AnyAVSounds", typeof(Boolean)); createCol(land, "GroupAVSounds", typeof(Boolean)); + createCol(land, "environment", typeof(string)); land.PrimaryKey = new DataColumn[] { land.Columns["UUID"] }; @@ -1917,6 +1918,36 @@ namespace OpenSim.Data.SQLite newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]); + if (row["environment"] is DBNull) + { + newData.Environment = null; + newData.EnvironmentVersion = -1; + } + else + { + string env = (string)row["environment"]; + if (string.IsNullOrEmpty(env)) + { + newData.Environment = null; + newData.EnvironmentVersion = -1; + } + else + { + try + { + ViewerEnvironment VEnv = ViewerEnvironment.FromOSDString(env); + newData.Environment = VEnv; + newData.EnvironmentVersion = VEnv.version; + } + catch + { + newData.Environment = null; + newData.EnvironmentVersion = -1; + } + } + } + + return newData; } @@ -2255,6 +2286,20 @@ namespace OpenSim.Data.SQLite row["AnyAVSounds"] = land.AnyAVSounds; row["GroupAVSounds"] = land.GroupAVSounds; + if (land.Environment == null) + row["environment"] = ""; + else + { + try + { + row["environment"] = ViewerEnvironment.ToOSDString(land.Environment); + } + catch + { + row["environment"] = ""; + } + } + } /// diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 8e14293f53..d5af5428d8 100755 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -223,7 +223,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments private void GetAttachmentsReport(ScenePresence sp, StringBuilder sb) { - sb.AppendFormat("Attachments for {0}\n\n", sp.Name); + sb.AppendFormat("Attachments for {0}\n", sp.Name); ConsoleDisplayList ct = new ConsoleDisplayList(); diff --git a/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs b/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs index cd1ab00105..dde6504c36 100644 --- a/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs +++ b/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs @@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare WindlightRefresh(0); } - public void WindlightRefresh(int interpolate, bool notforparcel = true) + public void WindlightRefresh(int interpolate, bool forRegion = true) { List ls = null; m_scene.ForEachRootScenePresence(delegate (ScenePresence sp) @@ -270,9 +270,11 @@ namespace OpenSim.Region.CoreModules.World.LightShare uint vflags = client.GetViewerCaps(); - if (notforparcel && (vflags & 0x8000) != 0) - m_estateModule.HandleRegionInfoRequest(client); - + if ((vflags & 0x8000) != 0) + { + if (forRegion) + m_estateModule.HandleRegionInfoRequest(client); + } else if ((vflags & 0x4000) != 0) m_eventQueue.WindlightRefreshEvent(interpolate, client.AgentId); @@ -434,7 +436,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare if (land != null && land.LandData != null) { land.StoreEnvironment(null); - WindlightRefresh(0); + WindlightRefresh(0, false); } }