Fixes bugs in world save (#297)

- [X] Fixes bugs in the buffer writer
- [X] Removes background save commands
- [X] Avoids calling Serialize() on deserialization
    - In a future optimization I will copy the entire object to a buffer, deserialize using a SpanReader, then use that buffer for the SaveBuffer
- [X] Fixes issue with decay queue.

Bumps release version
This commit is contained in:
Kamron Batman 2020-11-01 17:22:18 -08:00 • committed by GitHub
parent daf48ebdf2
commit 55935d30b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 122 additions and 153 deletions

View file

@ -50,7 +50,7 @@ namespace Server.Misc
if (m_Warning == TimeSpan.Zero)
{
Save(true);
Save();
}
else
{
@ -85,12 +85,7 @@ namespace Server.Misc
public static void Save()
{
Save(false);
}
public static void Save(bool permitBackgroundWrite)
{
if (AutoRestart.Restarting)
if (AutoRestart.Restarting || !World.Running)
{
return;
}
@ -118,10 +113,7 @@ namespace Server.Misc
var root = Path.Combine(Core.BaseDirectory, "Backups/Automatic");
if (!Directory.Exists(root))
{
Directory.CreateDirectory(root);
}
AssemblyHandler.EnsureDirectory(root);
var existing = Directory.GetDirectories(root);