From 7edaf1d851c5d2350deb93641d775e336d175a32 Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 19 Jun 2015 09:29:21 -0600 Subject: [PATCH] Add MaxMaterialsPerTransaction to SimFeatures Signed-off-by: Diva Canto --- .../OptionalModules/Materials/MaterialsModule.cs | 14 ++++++++++++++ bin/OpenSim.ini.example | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index 3ce6178a60..9413f09270 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs @@ -65,6 +65,7 @@ namespace OpenSim.Region.OptionalModules.Materials private Scene m_scene = null; private bool m_enabled = false; + private int m_maxMaterialsPerTransaction = 50; public Dictionary m_regionMaterials = new Dictionary(); @@ -74,7 +75,10 @@ namespace OpenSim.Region.OptionalModules.Materials IConfig config = source.Configs["Materials"]; if (config != null) + { m_enabled = config.GetBoolean("enable_materials", m_enabled); + m_maxMaterialsPerTransaction = config.GetInt("MaxMaterialsPerTransaction", m_maxMaterialsPerTransaction); + } if (m_enabled) m_log.DebugFormat("[Materials]: Initialized"); @@ -145,6 +149,16 @@ namespace OpenSim.Region.OptionalModules.Materials public void RegionLoaded(Scene scene) { + if (!m_enabled) return; + + ISimulatorFeaturesModule featuresModule = scene.RequestModuleInterface(); + if (featuresModule != null) + featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest; + } + + private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features) + { + features["MaxMaterialsPerTransaction"] = m_maxMaterialsPerTransaction; } /// diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 28a8dc2492..7a1a88d05b 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -789,7 +789,7 @@ ;# {enable_materials} {} {Enable Materials support?} {true false} true ;; This enables the use of Materials. ; enable_materials = true - + ; MaxMaterialsPerTransaction = 50 [DataSnapshot] ;# {index_sims} {} {Enable data snapshotting (search)?} {true false} false