World Save Backup Changes

- fixed the timestamps associated with the file, so they are the same as the timestamps in the directory.
- changed the ZipUtils ZipFile method to accept a directory, not an entry name.
This commit is contained in:
Brett Hewitson 2022-05-09 19:01:40 +10:00
parent 0f845d535c
commit 2c84798a02
7 changed files with 66 additions and 68 deletions

View file

@ -1962,7 +1962,7 @@ namespace ServerManagerTool.Lib
var saveFolderInfo = new DirectoryInfo(saveFolder);
// backup the world save file
ZipUtils.ZipFile(backupFile, worldFileName, worldFile, comment.ToString());
ZipUtils.ZipFile(backupFile, "", worldFile, comment.ToString());
if (Config.Default.AutoBackup_IncludeSaveGamesFolder)
{
@ -1976,7 +1976,7 @@ namespace ServerManagerTool.Lib
var saveGamesFiles = saveGamesFolderInfo.GetFiles(saveGamesFileFilter, SearchOption.AllDirectories);
foreach (var file in saveGamesFiles)
{
ZipUtils.ZipFile(backupFile, file.FullName.Replace(saveGamesFolder, Config.Default.SaveGamesRelativePath), file.FullName);
ZipUtils.ZipFile(backupFile, file.DirectoryName.Replace(saveGamesFolder, Config.Default.SaveGamesRelativePath), file.FullName);
}
}
}