diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs index 37a2d97..3d156ca 100644 --- a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs +++ b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs | |||
@@ -324,6 +324,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
324 | //If you don't want AutoBackup, we stop. | 324 | //If you don't want AutoBackup, we stop. |
325 | if ((state == null && !defaultState.GetEnabled()) || !state.GetEnabled ()) { | 325 | if ((state == null && !defaultState.GetEnabled()) || !state.GetEnabled ()) { |
326 | m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is NOT AutoBackup enabled."); | 326 | m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is NOT AutoBackup enabled."); |
327 | state = defaultState; | ||
327 | return state; | 328 | return state; |
328 | } else { | 329 | } else { |
329 | m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is AutoBackup ENABLED."); | 330 | m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is AutoBackup ENABLED."); |
@@ -346,6 +347,8 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
346 | state.SetEnabled (false); | 347 | state.SetEnabled (false); |
347 | return state; | 348 | return state; |
348 | } | 349 | } |
350 | if(state == null) | ||
351 | state = new AutoBackupModuleState(); | ||
349 | Timer tim = new Timer (interval); | 352 | Timer tim = new Timer (interval); |
350 | state.SetTimer (tim); | 353 | state.SetTimer (tim); |
351 | //Milliseconds -> minutes | 354 | //Milliseconds -> minutes |
@@ -357,12 +360,25 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup | |||
357 | } | 360 | } |
358 | 361 | ||
359 | //Add the current region to the list of regions tied to this timer. | 362 | //Add the current region to the list of regions tied to this timer. |
360 | if (timerMap.ContainsKey (state.GetTimer ())) { | 363 | if(state != null) |
361 | timerMap[state.GetTimer ()].Add (scene); | 364 | { |
362 | } else { | 365 | if (timerMap.ContainsKey (state.GetTimer ())) { |
363 | List<IScene> scns = new List<IScene> (1); | 366 | timerMap[state.GetTimer ()].Add (scene); |
364 | scns.Add (scene); | 367 | } else { |
365 | timerMap.Add (state.GetTimer (), scns); | 368 | List<IScene> scns = new List<IScene> (1); |
369 | scns.Add (scene); | ||
370 | timerMap.Add (state.GetTimer (), scns); | ||
371 | } | ||
372 | } | ||
373 | else | ||
374 | { | ||
375 | if(timerMap.ContainsKey(defaultState.GetTimer())) { | ||
376 | timerMap[defaultState.GetTimer()].Add(scene); | ||
377 | } else { | ||
378 | List<IScene> scns = new List<IScene> (1); | ||
379 | scns.Add(scene); | ||
380 | timerMap.Add(defaultState.GetTimer(), scns); | ||
381 | } | ||
366 | } | 382 | } |
367 | 383 | ||
368 | bool tmpBusyCheck = config.GetBoolean (prepend + "AutoBackupBusyCheck", defaultState.GetBusyCheck()); | 384 | bool tmpBusyCheck = config.GetBoolean (prepend + "AutoBackupBusyCheck", defaultState.GetBusyCheck()); |