diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs | 14 |
1 files changed, 14 insertions, 0 deletions
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 | |||
65 | 65 | ||
66 | private Scene m_scene = null; | 66 | private Scene m_scene = null; |
67 | private bool m_enabled = false; | 67 | private bool m_enabled = false; |
68 | private int m_maxMaterialsPerTransaction = 50; | ||
68 | 69 | ||
69 | public Dictionary<UUID, OSDMap> m_regionMaterials = new Dictionary<UUID, OSDMap>(); | 70 | public Dictionary<UUID, OSDMap> m_regionMaterials = new Dictionary<UUID, OSDMap>(); |
70 | 71 | ||
@@ -74,7 +75,10 @@ namespace OpenSim.Region.OptionalModules.Materials | |||
74 | 75 | ||
75 | IConfig config = source.Configs["Materials"]; | 76 | IConfig config = source.Configs["Materials"]; |
76 | if (config != null) | 77 | if (config != null) |
78 | { | ||
77 | m_enabled = config.GetBoolean("enable_materials", m_enabled); | 79 | m_enabled = config.GetBoolean("enable_materials", m_enabled); |
80 | m_maxMaterialsPerTransaction = config.GetInt("MaxMaterialsPerTransaction", m_maxMaterialsPerTransaction); | ||
81 | } | ||
78 | 82 | ||
79 | if (m_enabled) | 83 | if (m_enabled) |
80 | m_log.DebugFormat("[Materials]: Initialized"); | 84 | m_log.DebugFormat("[Materials]: Initialized"); |
@@ -145,6 +149,16 @@ namespace OpenSim.Region.OptionalModules.Materials | |||
145 | 149 | ||
146 | public void RegionLoaded(Scene scene) | 150 | public void RegionLoaded(Scene scene) |
147 | { | 151 | { |
152 | if (!m_enabled) return; | ||
153 | |||
154 | ISimulatorFeaturesModule featuresModule = scene.RequestModuleInterface<ISimulatorFeaturesModule>(); | ||
155 | if (featuresModule != null) | ||
156 | featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest; | ||
157 | } | ||
158 | |||
159 | private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features) | ||
160 | { | ||
161 | features["MaxMaterialsPerTransaction"] = m_maxMaterialsPerTransaction; | ||
148 | } | 162 | } |
149 | 163 | ||
150 | /// <summary> | 164 | /// <summary> |