Backup Bugfixes

- fixed the zip utils to read the file contents before backup.
- added new content backup metho for support zip creation.
This commit is contained in:
Brett Hewitson 2022-05-08 20:07:13 +10:00
parent 5374f8c7da
commit 1fc9bc87e4
13 changed files with 143 additions and 80 deletions

View file

@ -1962,7 +1962,7 @@ namespace ServerManagerTool.Lib
var saveFolderInfo = new DirectoryInfo(saveFolder);
// backup the world save file
ZipUtils.ZipAFile(backupFile, worldFileName, worldFile, comment.ToString());
ZipUtils.ZipFile(backupFile, worldFileName, 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.ZipAFile(backupFile, file.FullName.Replace(saveGamesFolder, Config.Default.SaveGamesRelativePath), file.FullName);
ZipUtils.ZipFile(backupFile, file.FullName.Replace(saveGamesFolder, Config.Default.SaveGamesRelativePath), file.FullName);
}
}
}

View file

@ -328,20 +328,23 @@ namespace ServerManagerTool.Lib
onlinePlayers.Add(newPlayer);
var playerJoined = false;
_players.AddOrUpdate(newPlayer.PlayerId,
(k) =>
{
playerJoined = true;
return newPlayer;
},
(k, v) =>
{
playerJoined = !v.IsOnline;
v.PlayerName = newPlayer.PlayerName;
v.IsOnline = newPlayer.IsOnline;
return v;
}
);
if (!string.IsNullOrWhiteSpace(newPlayer.PlayerName))
{
_players.AddOrUpdate(newPlayer.PlayerId,
(k) =>
{
playerJoined = true;
return newPlayer;
},
(k, v) =>
{
playerJoined = !v.IsOnline;
v.PlayerName = newPlayer.PlayerName;
v.IsOnline = newPlayer.IsOnline;
return v;
}
);
}
if (playerJoined)
{

View file

@ -721,7 +721,7 @@ namespace ServerManagerTool
ZipUtils.ZipFiles(zipFile, files, comment.ToString());
foreach (var kvp in obfuscateFiles)
{
ZipUtils.ZipAFile(zipFile, kvp.Key, kvp.Value);
ZipUtils.ZipContent(zipFile, kvp.Key, kvp.Value);
}
var message = _globalizer.GetResourceString("ServerSettings_SupportZipSuccessLabel").Replace("{filename}", Path.GetFileName(zipFile));

View file

@ -9,8 +9,8 @@
<entry>
<id>urn:uuid:AD8ABBB5-093A-4FDB-B473-FCED2DB46781</id>
<title>1.1.69 (1.1.69.5)</title>
<summary>1.1.69.5</summary>
<title>1.1.69 (1.1.69.6)</title>
<summary>1.1.69.6</summary>
<link href="" />
<updated>2022-05-08T00:00:00Z</updated>
<content type="xhtml">
@ -20,6 +20,7 @@
<br/>
<ul>
<li>Fixed an issue that would not send through the auto process messages via RCON using the correct mode selected in the global settings.</li>
<li>World Save Backup - fixed the backup of the files.</li>
</ul>
<u style="font-size: .9em;">CHANGE</u>
<br/>

View file

@ -7,6 +7,29 @@
<link href="http://servermanagers.freeforums.net/" />
<updated>2022-05-08T00:00:00Z</updated>
<entry>
<id>urn:uuid:72CA1005-0061-41A3-9883-F826B8F9F27F</id>
<title>1.1.69 (1.1.69.6)</title>
<summary>1.1.69.6</summary>
<link href="" />
<updated>2022-05-08T00:00:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p>
<u style="font-size: .9em;">BUGFIX</u>
<br/>
<ul>
<li>World Save Backup - fixed the backup of the files.</li>
</ul>
</p>
</div>
</content>
<author>
<name>bletch</name>
<email>bletch1971@hotmail.com</email>
</author>
</entry>
<entry>
<id>urn:uuid:68ECEA73-1C9C-4DCB-807B-0D812E986993</id>
<title>1.1.69 (1.1.69.5)</title>