Fix for RunUO Crash if Performance tab on Admin gump is open within first 100seconds of server running.

Completion of the DynamicSaveStrategy.  Background saves are now safe; triggered only by the autoSave or command [BackgroundSave ([BGSave)
This commit is contained in:
asayre 2010-12-20 03:34:25 +00:00
parent 0afa707b24
commit 67af95cf0b
12 changed files with 169 additions and 84 deletions

View file

@ -52,7 +52,7 @@ namespace Server.Misc
if ( m_Warning == TimeSpan.Zero )
{
Save();
Save( true );
}
else
{
@ -72,14 +72,21 @@ namespace Server.Misc
}
public static void Save()
{
AutoSave.Save( false );
}
public static void Save( bool permitBackgroundWrite )
{
if ( AutoRestart.Restarting )
return;
try{ Backup(); }
catch (Exception e) { Console.WriteLine("WARNING: Automatic backup FAILED: {0}", e); }
World.WaitForWriteCompletion();
World.Save();
try{ Backup(); }
catch ( Exception e ) { Console.WriteLine("WARNING: Automatic backup FAILED: {0}", e); }
World.Save( true, permitBackgroundWrite );
}
private static string[] m_Backups = new string[]

View file

@ -25,11 +25,14 @@ namespace Server.Misc
public static void CrashGuard_OnCrash( CrashedEventArgs e )
{
if ( GenerateReport )
GenerateCrashReport( e );
World.WaitForWriteCompletion();
if ( SaveBackup )
Backup();
if ( GenerateReport )
GenerateCrashReport( e );
/*if ( Core.Service )
e.Close = true;