From 06a4810d210fcbfe1a859317698f791129ecdaf1 Mon Sep 17 00:00:00 2001 From: Sean McNamara Date: Sat, 19 Feb 2011 22:29:45 -0500 Subject: Fix config source by taking it from Initialize --- OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs index 7593b95..68cf219 100644 --- a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs +++ b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs @@ -169,6 +169,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup readonly Dictionary states = new Dictionary(4); readonly Dictionary timers = new Dictionary(1); readonly Dictionary> timerMap = new Dictionary>(1); + private IConfigSource m_configSource = null; private bool m_Enabled = false; //Whether the shared module should be enabled at all. NOT the same as m_Enabled in AutoBackupModuleState! public AutoBackupModule () @@ -180,6 +181,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup void IRegionModuleBase.Initialise (Nini.Config.IConfigSource source) { //Determine if we have been enabled at all in OpenSim.ini -- this is part and parcel of being an optional module + m_configSource = source; IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) { @@ -236,7 +238,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup states.Add(scene, st); //Read the config settings and set variables. - IConfig config = scene.Config.Configs[scene.RegionInfo.RegionName]; + IConfig config = m_configSource.Configs[scene.RegionInfo.RegionName]; st.SetEnabled(config.GetBoolean("AutoBackup", false)); if(!st.GetEnabled()) //If you don't want AutoBackup, we stop. return; -- cgit v1.1