fix(core): Fixes flow for saves, adds logging and configurations (#513)
- [X] Adds better diagnostics for world saves. - [X] Adds world save stats. - [X] World now saves to a temporary folder. - [X] Backups are now stored by timestamp. - [X] Backup is now made after the world save. - [X] "Saves" folder is now configurable. - [X] Temporary folder is now configurable. - [X] Backups folder is now configurable.
This commit is contained in:
parent
6f5312cb89
commit
da01f5b8a5
19 changed files with 325 additions and 210 deletions
|
|
@ -100,7 +100,7 @@ namespace Server.Misc
|
|||
|
||||
try
|
||||
{
|
||||
var timeStamp = GetTimeStamp();
|
||||
var timeStamp = Utility.GetTimeStamp();
|
||||
|
||||
var root = Core.BaseDirectory;
|
||||
var rootBackup = Path.Combine(root, $"Backups/Crashed/{timeStamp}/");
|
||||
|
|
@ -137,7 +137,7 @@ namespace Server.Misc
|
|||
|
||||
try
|
||||
{
|
||||
var timeStamp = GetTimeStamp();
|
||||
var timeStamp = Utility.GetTimeStamp();
|
||||
var fileName = $"Crash {timeStamp}.log";
|
||||
|
||||
var root = Core.BaseDirectory;
|
||||
|
|
@ -219,12 +219,5 @@ namespace Server.Misc
|
|||
Console.WriteLine("failed");
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetTimeStamp()
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
return $"{now.Day}-{now.Month}-{now.Year}-{now.Hour}-{now.Minute}-{now.Second}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue