Fix some NREs on certain paths.

bulletsim
Sean McNamara 2011-04-11 13:12:26 -04:00
parent 4974a1ce69
commit 4ad05fb01d
1 changed files with 22 additions and 6 deletions

View File

@ -324,6 +324,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
//If you don't want AutoBackup, we stop. //If you don't want AutoBackup, we stop.
if ((state == null && !defaultState.GetEnabled()) || !state.GetEnabled ()) { if ((state == null && !defaultState.GetEnabled()) || !state.GetEnabled ()) {
m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is NOT AutoBackup enabled."); m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is NOT AutoBackup enabled.");
state = defaultState;
return state; return state;
} else { } else {
m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is AutoBackup ENABLED."); m_log.Info ("[AUTO BACKUP]: Region " + sRegionLabel + " is AutoBackup ENABLED.");
@ -346,6 +347,8 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
state.SetEnabled (false); state.SetEnabled (false);
return state; return state;
} }
if(state == null)
state = new AutoBackupModuleState();
Timer tim = new Timer (interval); Timer tim = new Timer (interval);
state.SetTimer (tim); state.SetTimer (tim);
//Milliseconds -> minutes //Milliseconds -> minutes
@ -357,6 +360,8 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
} }
//Add the current region to the list of regions tied to this timer. //Add the current region to the list of regions tied to this timer.
if(state != null)
{
if (timerMap.ContainsKey (state.GetTimer ())) { if (timerMap.ContainsKey (state.GetTimer ())) {
timerMap[state.GetTimer ()].Add (scene); timerMap[state.GetTimer ()].Add (scene);
} else { } else {
@ -364,6 +369,17 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
scns.Add (scene); scns.Add (scene);
timerMap.Add (state.GetTimer (), scns); timerMap.Add (state.GetTimer (), scns);
} }
}
else
{
if(timerMap.ContainsKey(defaultState.GetTimer())) {
timerMap[defaultState.GetTimer()].Add(scene);
} else {
List<IScene> scns = new List<IScene> (1);
scns.Add(scene);
timerMap.Add(defaultState.GetTimer(), scns);
}
}
bool tmpBusyCheck = config.GetBoolean (prepend + "AutoBackupBusyCheck", defaultState.GetBusyCheck()); bool tmpBusyCheck = config.GetBoolean (prepend + "AutoBackupBusyCheck", defaultState.GetBusyCheck());
if(state == null && tmpBusyCheck != defaultState.GetBusyCheck()) if(state == null && tmpBusyCheck != defaultState.GetBusyCheck())