aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorSean McNamara2011-04-12 01:14:21 -0400
committerSean McNamara2011-04-12 01:14:21 -0400
commit049bce4d003f6854868306c7d98f7b5a501cb047 (patch)
treec44a3eb6568c8c23ea26e26481a8a298783cbbe3 /OpenSim
parentFix NREs harder. (diff)
downloadopensim-SC_OLD-049bce4d003f6854868306c7d98f7b5a501cb047.zip
opensim-SC_OLD-049bce4d003f6854868306c7d98f7b5a501cb047.tar.gz
opensim-SC_OLD-049bce4d003f6854868306c7d98f7b5a501cb047.tar.bz2
opensim-SC_OLD-049bce4d003f6854868306c7d98f7b5a501cb047.tar.xz
Fixup the global defaults config parsing code.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs40
1 files changed, 25 insertions, 15 deletions
diff --git a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs
index e52e9cb..364697b 100644
--- a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs
+++ b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs
@@ -238,7 +238,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
238 defTimer.AutoReset = true; 238 defTimer.AutoReset = true;
239 defTimer.Start (); 239 defTimer.Start ();
240 240
241 AutoBackupModuleState abms = ParseConfig(null, false); 241 AutoBackupModuleState abms = ParseConfig(null, true);
242 m_log.Debug("[AUTO BACKUP]: Config for default"); 242 m_log.Debug("[AUTO BACKUP]: Config for default");
243 m_log.Debug(abms.ToString()); 243 m_log.Debug(abms.ToString());
244 } 244 }
@@ -262,16 +262,23 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
262 if (!m_Enabled) 262 if (!m_Enabled)
263 return; 263 return;
264 264
265 AutoBackupModuleState abms = states[scene]; 265 if(states.ContainsKey(scene))
266 Timer timer = abms.GetTimer (); 266 {
267 List<IScene> list = timerMap[timer]; 267 AutoBackupModuleState abms = states[scene];
268 list.Remove (scene); 268
269 if (list.Count == 0) { 269 //Remove this scene out of the timer map list
270 timerMap.Remove (timer); 270 Timer timer = abms.GetTimer ();
271 timers.Remove (timer.Interval); 271 List<IScene> list = timerMap[timer];
272 timer.Close (); 272 list.Remove (scene);
273
274 //Shut down the timer if this was the last scene for the timer
275 if (list.Count == 0) {
276 timerMap.Remove (timer);
277 timers.Remove (timer.Interval);
278 timer.Close ();
279 }
280 states.Remove(scene);
273 } 281 }
274 states.Remove(scene);
275 } 282 }
276 283
277 void IRegionModuleBase.RegionLoaded (Framework.Scenes.Scene scene) 284 void IRegionModuleBase.RegionLoaded (Framework.Scenes.Scene scene)
@@ -283,9 +290,9 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
283 if (scene == null) 290 if (scene == null)
284 return; 291 return;
285 292
286 AutoBackupModuleState abms = ParseConfig(scene, true); 293 AutoBackupModuleState abms = ParseConfig(scene, false);
287 m_log.Debug("[AUTO BACKUP]: Config for " + scene.RegionInfo.RegionName); 294 m_log.Debug("[AUTO BACKUP]: Config for " + scene.RegionInfo.RegionName);
288 m_log.Debug(abms.ToString()); 295 m_log.Debug((abms == null ? "DEFAULT" : abms.ToString()));
289 } 296 }
290 297
291 AutoBackupModuleState ParseConfig (IScene scene, bool parseDefault) 298 AutoBackupModuleState ParseConfig (IScene scene, bool parseDefault)
@@ -322,13 +329,16 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
322 if(state == null && tmpEnabled != defaultState.GetEnabled()) //Varies from default state 329 if(state == null && tmpEnabled != defaultState.GetEnabled()) //Varies from default state
323 { 330 {
324 state = new AutoBackupModuleState(); 331 state = new AutoBackupModuleState();
325 state.SetEnabled (tmpEnabled); 332 }
333
334 if(state != null)
335 {
336 state.SetEnabled (tmpEnabled);
326 } 337 }
327 338
328 //If you don't want AutoBackup, we stop. 339 //If you don't want AutoBackup, we stop.
329 if ((state == null && !defaultState.GetEnabled()) || !state.GetEnabled ()) { 340 if ((state == null && !defaultState.GetEnabled()) || (state != null && !state.GetEnabled ())) {
330 m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is NOT AutoBackup enabled."); 341 m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is NOT AutoBackup enabled.");
331 state = defaultState;
332 return state; 342 return state;
333 } else { 343 } else {
334 m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is AutoBackup ENABLED."); 344 m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is AutoBackup ENABLED.");