diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2774b1027..019f2c280 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -54,7 +54,7 @@ body: label: Version description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu. options: - - v1.0.13.1 + - v1.0.13.2 - Other validations: required: true diff --git a/Barotrauma/BarotraumaClient/ClientSource/ContentManagement/ContentPackage/ModProject.cs b/Barotrauma/BarotraumaClient/ClientSource/ContentManagement/ContentPackage/ModProject.cs index 1e40e293b..4c883b07d 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/ContentManagement/ContentPackage/ModProject.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/ContentManagement/ContentPackage/ModProject.cs @@ -86,7 +86,7 @@ namespace Barotrauma public string ModVersion = ContentPackage.DefaultModVersion; - public Md5Hash? ExpectedHash { get; private set; } + public Md5Hash? ExpectedHash { get; set; } public bool IsCore = false; diff --git a/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs b/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs index de2872b6f..be752ce98 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs @@ -3560,6 +3560,7 @@ namespace Barotrauma foreach (var subElement in info.SubmarineElement.Elements()) { int id = subElement.GetAttributeInt("ID", -1); + if (id == -1) { continue; } Identifier identifier = subElement.GetAttributeIdentifier("identifier", string.Empty); if (entities.TryGetValue(id, out Identifier duplicateEntity)) { diff --git a/Barotrauma/BarotraumaClient/ClientSource/Steam/Workshop.cs b/Barotrauma/BarotraumaClient/ClientSource/Steam/Workshop.cs index ed270c344..bac896004 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Steam/Workshop.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Steam/Workshop.cs @@ -163,7 +163,7 @@ namespace Barotrauma.Steam CrossThread.RequestExecutionOnMainThread(() => ContentPackageManager.LocalPackages.Refresh()); } - public static async Task CreatePublishStagingCopy(string modVersion, ContentPackage contentPackage) + public static async Task CreatePublishStagingCopy(string title, string modVersion, ContentPackage contentPackage) { await Task.Yield(); @@ -184,11 +184,12 @@ namespace Barotrauma.Steam throw new Exception("Staging copy could not be loaded", result.TryUnwrapFailure(out var exception) ? exception : null); } - - //Load filelist.xml and write the hash into it so anyone downloading this mod knows what it should be + + //Load filelist.xml and write the hash into it so anyone downloading this mod knows what it should be ModProject modProject = new ModProject(tempPkg) { - ModVersion = modVersion + ModVersion = modVersion, + ExpectedHash = tempPkg.CalculateHash(name: title, modVersion: modVersion) }; modProject.Save(stagingFileListPath); } diff --git a/Barotrauma/BarotraumaClient/ClientSource/Steam/WorkshopMenu/Mutable/PublishTab.cs b/Barotrauma/BarotraumaClient/ClientSource/Steam/WorkshopMenu/Mutable/PublishTab.cs index e3de26b71..d8525089f 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Steam/WorkshopMenu/Mutable/PublishTab.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Steam/WorkshopMenu/Mutable/PublishTab.cs @@ -478,7 +478,7 @@ namespace Barotrauma.Steam bool stagingReady = false; Exception? stagingException = null; TaskPool.Add("CreatePublishStagingCopy", - SteamManager.Workshop.CreatePublishStagingCopy(modVersion, localPackage), + SteamManager.Workshop.CreatePublishStagingCopy(editor.Title ?? localPackage.Name, modVersion, localPackage), (t) => { stagingReady = true; diff --git a/Barotrauma/BarotraumaClient/LinuxClient.csproj b/Barotrauma/BarotraumaClient/LinuxClient.csproj index a85f9ce9a..0b53b9dae 100644 --- a/Barotrauma/BarotraumaClient/LinuxClient.csproj +++ b/Barotrauma/BarotraumaClient/LinuxClient.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.0.13.1 + 1.0.13.2 Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/MacClient.csproj b/Barotrauma/BarotraumaClient/MacClient.csproj index 9fc8489bd..a708f095c 100644 --- a/Barotrauma/BarotraumaClient/MacClient.csproj +++ b/Barotrauma/BarotraumaClient/MacClient.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.0.13.1 + 1.0.13.2 Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/WindowsClient.csproj b/Barotrauma/BarotraumaClient/WindowsClient.csproj index 3e77a5edd..ccc4469d0 100644 --- a/Barotrauma/BarotraumaClient/WindowsClient.csproj +++ b/Barotrauma/BarotraumaClient/WindowsClient.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.0.13.1 + 1.0.13.2 Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaServer/LinuxServer.csproj b/Barotrauma/BarotraumaServer/LinuxServer.csproj index 7f0b43c21..3b4b1c437 100644 --- a/Barotrauma/BarotraumaServer/LinuxServer.csproj +++ b/Barotrauma/BarotraumaServer/LinuxServer.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.0.13.1 + 1.0.13.2 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/MacServer.csproj b/Barotrauma/BarotraumaServer/MacServer.csproj index dd089e50b..a341c3d11 100644 --- a/Barotrauma/BarotraumaServer/MacServer.csproj +++ b/Barotrauma/BarotraumaServer/MacServer.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.0.13.1 + 1.0.13.2 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/WindowsServer.csproj b/Barotrauma/BarotraumaServer/WindowsServer.csproj index 509ffe7a7..e018f5e1c 100644 --- a/Barotrauma/BarotraumaServer/WindowsServer.csproj +++ b/Barotrauma/BarotraumaServer/WindowsServer.csproj @@ -11,7 +11,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.0.13.1 + 1.0.13.2 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentPackage/ContentPackage.cs b/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentPackage/ContentPackage.cs index d4a75eb27..01cd9319c 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentPackage/ContentPackage.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentPackage/ContentPackage.cs @@ -23,7 +23,7 @@ namespace Barotrauma : string.Empty); } - public static readonly Version MinimumHashCompatibleVersion = new Version(1, 0, 11, 0); + public static readonly Version MinimumHashCompatibleVersion = new Version(1, 0, 13, 2); public const string LocalModsDir = "LocalMods"; public static readonly string WorkshopModsDir = Barotrauma.IO.Path.Combine( @@ -177,7 +177,7 @@ namespace Barotrauma } } - public Md5Hash CalculateHash(bool logging = false) + public Md5Hash CalculateHash(bool logging = false, string? name = null, string? modVersion = null) { using IncrementalHash incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.MD5); @@ -205,11 +205,12 @@ namespace Barotrauma } } - if (UgcId.TryUnwrap(out ContentPackageId? id) && id != null) + string selectedName = name ?? Name; + if (!selectedName.IsNullOrEmpty()) { - incrementalHash.AppendData(Encoding.UTF8.GetBytes(id.StringRepresentation)); + incrementalHash.AppendData(Encoding.UTF8.GetBytes(selectedName)); } - incrementalHash.AppendData(Encoding.UTF8.GetBytes(ModVersion)); + incrementalHash.AppendData(Encoding.UTF8.GetBytes(modVersion ?? ModVersion)); var md5Hash = Md5Hash.BytesAsHash(incrementalHash.GetHashAndReset()); if (logging) diff --git a/Barotrauma/BarotraumaShared/changelog.txt b/Barotrauma/BarotraumaShared/changelog.txt index 3eb16ac17..02bf3c4b2 100644 --- a/Barotrauma/BarotraumaShared/changelog.txt +++ b/Barotrauma/BarotraumaShared/changelog.txt @@ -1,3 +1,10 @@ +--------------------------------------------------------------------------------------------------------- +v1.0.13.2 +--------------------------------------------------------------------------------------------------------- + +- Fixed "hash mismatch" errors when trying to enable a mod that's been updated in the most recent patch. +- Fixed "the submarine contains entities with duplicate IDs" error message when loading a submarine that contains multiple shuttles/drones. + --------------------------------------------------------------------------------------------------------- v1.0.13.1 ---------------------------------------------------------------------------------------------------------