mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
World Save Zipping
- have changed the way the zip file is created. All files are now added to the zip in one pass, rather than as separate files.
This commit is contained in:
parent
1c463ded1d
commit
99c4ed73fc
7 changed files with 121 additions and 184 deletions
|
|
@ -1991,7 +1991,10 @@ namespace ServerManagerTool.Lib
|
|||
var saveFolderInfo = new DirectoryInfo(saveFolder);
|
||||
|
||||
// backup the world save file
|
||||
ZipUtils.ZipFile(backupFile, "", worldFile, comment.ToString());
|
||||
var files = new Dictionary<string, List<string>>
|
||||
{
|
||||
{ "", new List<string> { worldFile } }
|
||||
};
|
||||
|
||||
if (Config.Default.AutoBackup_IncludeSaveGamesFolder)
|
||||
{
|
||||
|
|
@ -2005,11 +2008,17 @@ namespace ServerManagerTool.Lib
|
|||
var saveGamesFiles = saveGamesFolderInfo.GetFiles(saveGamesFileFilter, SearchOption.AllDirectories);
|
||||
foreach (var file in saveGamesFiles)
|
||||
{
|
||||
ZipUtils.ZipFile(backupFile, file.DirectoryName.Replace(saveGamesFolder, Config.Default.SaveGamesRelativePath), file.FullName);
|
||||
var key = file.DirectoryName.Replace(saveGamesFolder, Config.Default.SaveGamesRelativePath);
|
||||
if (files.ContainsKey(key))
|
||||
files[key].Add(file.FullName);
|
||||
else
|
||||
files.Add(key, new List<string> { file.FullName });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ZipUtils.ZipFiles(backupFile, files, comment.ToString());
|
||||
|
||||
LogProfileMessage($"Backed up world files - {saveFolder}");
|
||||
LogProfileMessage($"Backup file created - {backupFile}");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue