Unstable 0.13.3.11

This commit is contained in:
Markus Isberg
2021-04-28 16:10:00 +03:00
parent bf743f1e99
commit 3f324b14e8
18 changed files with 60 additions and 53 deletions
@@ -1078,11 +1078,25 @@ namespace Barotrauma
pendingWorkshopDownloads.Remove(itemId);
currentlyDownloadingWorkshopItem = null;
void onInstall(ContentPackage resultingPackage)
{
if (!resultingPackage.MD5hash.Hash.Equals(clearedDownload.ExpectedHash))
{
workshopDownloadsFrame?.FindChild((c) => c.UserData is ulong l && l == itemId, true)?.Flash(GUI.Style.Red);
CancelWorkshopDownloads();
GameMain.Client?.Disconnect();
GameMain.Client = null;
new GUIMessageBox(
TextManager.Get("ConnectionLost"),
TextManager.GetWithVariable("DisconnectMessage.MismatchedWorkshopMod", "[incompatiblecontentpackage]", $"\"{resultingPackage.Name}\" (hash {resultingPackage.MD5hash.ShortHash})"));
}
}
if (SteamManager.CheckWorkshopItemInstalled(item))
{
SteamManager.UninstallWorkshopItem(item, false, out _);
}
if (SteamManager.InstallWorkshopItem(item, out string errorMsg, enableContentPackage: false, suppressInstallNotif: true))
if (SteamManager.InstallWorkshopItem(item, out string errorMsg, enableContentPackage: false, suppressInstallNotif: true, onInstall: onInstall))
{
workshopDownloadsFrame?.FindChild((c) => c.UserData is ulong l && l == itemId, true)?.Flash(GUI.Style.Green);
}
@@ -1091,16 +1105,6 @@ namespace Barotrauma
workshopDownloadsFrame?.FindChild((c) => c.UserData is ulong l && l == itemId, true)?.Flash(GUI.Style.Red);
DebugConsole.ThrowError(errorMsg);
}
ContentPackage resultingPackage = ContentPackage.AllPackages.FirstOrDefault(p => p.MD5hash.Hash == clearedDownload.ExpectedHash);
if (resultingPackage == null)
{
workshopDownloadsFrame?.FindChild((c) => c.UserData is ulong l && l == itemId, true)?.Flash(GUI.Style.Red);
CancelWorkshopDownloads();
new GUIMessageBox(
TextManager.Get("ConnectionLost"),
TextManager.GetWithVariable("DisconnectMessage.MismatchedWorkshopMod", "incompatiblecontentpackage", $"\"{resultingPackage.Name}\" (hash {resultingPackage.MD5hash.ShortHash})"));
}
});
}
}