From dc82ad0f7abe5f09675dfc3768da2a0134503916 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 15 Aug 2012 02:06:22 +0100 Subject: Add a skeleton for a name value storage associated with regions --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 13 +++++++++++ OpenSim/Data/MySQL/MySQLSimulationData.cs | 13 +++++++++++ .../Data/MySQL/Resources/RegionStore.migrations | 7 ++++++ OpenSim/Data/Null/NullSimulationData.cs | 13 +++++++++++ OpenSim/Data/SQLite/SQLiteSimulationData.cs | 12 ++++++++++ .../Framework/Interfaces/ISimulationDataService.cs | 5 +++++ .../Framework/Interfaces/ISimulationDataStore.cs | 6 +++++ OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++++ .../Connectors/Simulation/SimulationDataService.cs | 14 ++++++++++++ OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 26 ++++++++++++++++++++++ 10 files changed, 113 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index 3f29f5b..17f42e1 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -2202,5 +2202,18 @@ VALUES } } } + + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } } diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 1a2e113..be985ab 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1966,5 +1966,18 @@ namespace OpenSim.Data.MySQL } } } + + public void SaveExtra(UUID regionID, string name, string val) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } } diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 4a925fb..5b59779 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations @@ -895,3 +895,10 @@ CREATE TABLE `regionenvironment` ( COMMIT; +:VERSION 45 + +BEGIN; + +CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`)); + +COMMIT; diff --git a/OpenSim/Data/Null/NullSimulationData.cs b/OpenSim/Data/Null/NullSimulationData.cs index 8f2314f..4979cf6 100644 --- a/OpenSim/Data/Null/NullSimulationData.cs +++ b/OpenSim/Data/Null/NullSimulationData.cs @@ -151,5 +151,18 @@ namespace OpenSim.Data.Null public void Shutdown() { } + + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } } diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index f40e866..56df3cb 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -2890,5 +2890,17 @@ namespace OpenSim.Data.SQLite } } + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } } diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs index 0fcafcc..085b5ca 100644 --- a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs @@ -116,5 +116,10 @@ namespace OpenSim.Region.Framework.Interfaces /// the region UUID void RemoveRegionEnvironmentSettings(UUID regionUUID); + void SaveExtra(UUID regionID, string name, string value); + + void RemoveExtra(UUID regionID, string name); + + Dictionary GetExtra(UUID regionID); } } diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs index e424976..3787ca0 100644 --- a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs @@ -127,6 +127,12 @@ namespace OpenSim.Region.Framework.Interfaces /// the region UUID void RemoveRegionEnvironmentSettings(UUID regionUUID); + void SaveExtra(UUID regionID, string name, string val); + + void RemoveExtra(UUID regionID, string name); + + Dictionary GetExtra(UUID regionID); + void Shutdown(); } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0967c34..59f49ea 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -174,6 +174,8 @@ namespace OpenSim.Region.Framework.Scenes protected ICapabilitiesModule m_capsModule; protected IGroupsModule m_groupsModule; + private Dictionary m_extraSettings; + /// /// Current scene frame number /// @@ -635,6 +637,8 @@ namespace OpenSim.Region.Framework.Scenes // FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new // region is set up and avoid these gyrations. RegionSettings rs = simDataService.LoadRegionSettings(RegionInfo.RegionID); + m_extraSettings = simDataService.GetExtra(RegionInfo.RegionID); + bool updatedTerrainTextures = false; if (rs.TerrainTexture1 == UUID.Zero) { diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs index c9cbbfa..504fcaf 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs @@ -164,5 +164,19 @@ namespace OpenSim.Services.Connectors m_database.RemoveRegionEnvironmentSettings(regionUUID); } + public void SaveExtra(UUID regionID, string name, string val) + { + m_database.SaveExtra(regionID, name, val); + } + + public void RemoveExtra(UUID regionID, string name) + { + m_database.RemoveExtra(regionID, name); + } + + public Dictionary GetExtra(UUID regionID) + { + return m_database.GetExtra(regionID); + } } } diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 1845eb9..ed29c39 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -127,6 +127,19 @@ namespace OpenSim.Data.Null { m_store.RemoveRegionEnvironmentSettings(regionUUID); } + + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } /// @@ -318,5 +331,18 @@ namespace OpenSim.Data.Null public void Shutdown() { } + + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } } -- cgit v1.1