Unstable 0.17.9.0

This commit is contained in:
Markus Isberg
2022-04-12 03:39:02 +09:00
parent 374f03c625
commit 72328c29cb
38 changed files with 361 additions and 184 deletions
@@ -11,8 +11,18 @@ namespace Barotrauma.Steam
{
public static class BulkDownloader
{
private static void CloseAllMessageBoxes()
{
GUIMessageBox.MessageBoxes.ForEachMod(b =>
{
if (b is GUIMessageBox m) { m.Close(); }
else { GUIMessageBox.MessageBoxes.Remove(b); }
});
}
public static void PrepareUpdates()
{
CloseAllMessageBoxes();
GUIMessageBox msgBox = new GUIMessageBox(headerText: "", text: TextManager.Get("DeterminingRequiredModUpdates"),
buttons: Array.Empty<LocalizedString>());
TaskPool.Add(
@@ -29,6 +39,7 @@ namespace Barotrauma.Steam
internal static void SubscribeToServerMods(IEnumerable<UInt64> missingIds, string rejoinEndpoint, ulong rejoinLobby, string rejoinServerName)
{
CloseAllMessageBoxes();
GUIMessageBox msgBox = new GUIMessageBox(headerText: "", text: TextManager.Get("PreparingWorkshopDownloads"),
buttons: Array.Empty<LocalizedString>());
TaskPool.Add(
@@ -202,7 +202,22 @@ namespace Barotrauma.Steam
}
DateTime getEditTime(ContentPackage p)
=> File.GetLastWriteTime(Path.GetDirectoryName(p.Path)!);
{
DateTime writeTime = File.GetLastWriteTime(p.Dir);
//File.GetLastWriteTime on the directory is not good enough;
//it's possible to update a file in a directory without
//updating its parent directories' write time, so let's
//look at all of those files
var files = Directory.GetFiles(p.Dir, "*", System.IO.SearchOption.AllDirectories);
foreach (var file in files)
{
DateTime newTime = File.GetLastWriteTime(file);
if (newTime > writeTime) { writeTime = newTime; }
}
return writeTime;
}
//Find local packages associated with the Workshop items if available
(Steamworks.Ugc.Item WorkshopItem, ContentPackage? LocalPackage)[] publishedItems = workshopItems