From da259033006c33f83872feae5737398fcffa6639 Mon Sep 17 00:00:00 2001 From: H-H-H Date: Thu, 20 Mar 2014 21:32:33 +0000 Subject: Adding a way to disable/enable the in built Dwell Module --- OpenSim/Region/CoreModules/World/Land/DwellModule.cs | 20 +++++++++++++++++--- bin/OpenSimDefaults.ini | 3 +++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs index bd22155..d17c517 100644 --- a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs @@ -52,10 +52,12 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.World.Land { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DwellModule")] - public class DwellModule : IDwellModule, INonSharedRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DefaultDwellModule")] + public class DefaultDwellModule : IDwellModule, INonSharedRegionModule { private Scene m_scene; + private IConfigSource m_Config; + private bool m_Enabled = false; public Type ReplaceableInterface { @@ -64,15 +66,27 @@ namespace OpenSim.Region.CoreModules.World.Land public string Name { - get { return "DwellModule"; } + get { return "DefaultDwellModule"; } } public void Initialise(IConfigSource source) { + m_Config = source; + + IConfig DwellConfig = m_Config.Configs ["Dwell"]; + + if (DwellConfig == null) { + m_Enabled = false; + return; + } + m_Enabled = (DwellConfig.GetString ("DwellModule", "DefaultDwellModule") == "DefaultDwellModule"); } public void AddRegion(Scene scene) { + if (!m_Enabled) + return; + m_scene = scene; m_scene.EventManager.OnNewClient += OnNewClient; diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index f59dbf2..d8474d3 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -1791,6 +1791,9 @@ ;; Default time interval (in ms) for the throttle service thread to wake up Interval = 5000 +[Dwell] + ;; This enables the built in basic dwell module + DwellModule = DefaultDwellModule [Modules] Include-modules = "addon-modules/*/config/*.ini" -- cgit v1.1