From 7edaf1d851c5d2350deb93641d775e336d175a32 Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 19 Jun 2015 09:29:21 -0600 Subject: Add MaxMaterialsPerTransaction to SimFeatures Signed-off-by: Diva Canto --- .../Region/OptionalModules/Materials/MaterialsModule.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index 3ce6178..9413f09 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; } /// -- cgit v1.1