This commit is contained in:
EvilFactory
2023-05-11 11:22:12 -03:00
13 changed files with 28 additions and 18 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ body:
label: Version 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. 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: options:
- v1.0.13.1 - v1.0.13.2
- Other - Other
validations: validations:
required: true required: true
@@ -86,7 +86,7 @@ namespace Barotrauma
public string ModVersion = ContentPackage.DefaultModVersion; public string ModVersion = ContentPackage.DefaultModVersion;
public Md5Hash? ExpectedHash { get; private set; } public Md5Hash? ExpectedHash { get; set; }
public bool IsCore = false; public bool IsCore = false;
@@ -3560,6 +3560,7 @@ namespace Barotrauma
foreach (var subElement in info.SubmarineElement.Elements()) foreach (var subElement in info.SubmarineElement.Elements())
{ {
int id = subElement.GetAttributeInt("ID", -1); int id = subElement.GetAttributeInt("ID", -1);
if (id == -1) { continue; }
Identifier identifier = subElement.GetAttributeIdentifier("identifier", string.Empty); Identifier identifier = subElement.GetAttributeIdentifier("identifier", string.Empty);
if (entities.TryGetValue(id, out Identifier duplicateEntity)) if (entities.TryGetValue(id, out Identifier duplicateEntity))
{ {
@@ -163,7 +163,7 @@ namespace Barotrauma.Steam
CrossThread.RequestExecutionOnMainThread(() => ContentPackageManager.LocalPackages.Refresh()); 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(); await Task.Yield();
@@ -184,11 +184,12 @@ namespace Barotrauma.Steam
throw new Exception("Staging copy could not be loaded", throw new Exception("Staging copy could not be loaded",
result.TryUnwrapFailure(out var exception) ? exception : null); 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) ModProject modProject = new ModProject(tempPkg)
{ {
ModVersion = modVersion ModVersion = modVersion,
ExpectedHash = tempPkg.CalculateHash(name: title, modVersion: modVersion)
}; };
modProject.Save(stagingFileListPath); modProject.Save(stagingFileListPath);
} }
@@ -478,7 +478,7 @@ namespace Barotrauma.Steam
bool stagingReady = false; bool stagingReady = false;
Exception? stagingException = null; Exception? stagingException = null;
TaskPool.Add("CreatePublishStagingCopy", TaskPool.Add("CreatePublishStagingCopy",
SteamManager.Workshop.CreatePublishStagingCopy(modVersion, localPackage), SteamManager.Workshop.CreatePublishStagingCopy(editor.Title ?? localPackage.Name, modVersion, localPackage),
(t) => (t) =>
{ {
stagingReady = true; stagingReady = true;
@@ -11,7 +11,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>1.0.13.1</Version> <Version>1.0.13.2</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright> <Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
+1 -1
View File
@@ -11,7 +11,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>1.0.13.1</Version> <Version>1.0.13.2</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright> <Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
@@ -11,7 +11,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>1.0.13.1</Version> <Version>1.0.13.2</Version>
<Copyright>Copyright © FakeFish 2018-2023</Copyright> <Copyright>Copyright © FakeFish 2018-2023</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
@@ -11,7 +11,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>1.0.13.1</Version> <Version>1.0.13.2</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
+1 -1
View File
@@ -11,7 +11,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>1.0.13.1</Version> <Version>1.0.13.2</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
@@ -11,7 +11,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>1.0.13.1</Version> <Version>1.0.13.2</Version>
<Copyright>Copyright © FakeFish 2018-2022</Copyright> <Copyright>Copyright © FakeFish 2018-2022</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
@@ -23,7 +23,7 @@ namespace Barotrauma
: string.Empty); : 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 const string LocalModsDir = "LocalMods";
public static readonly string WorkshopModsDir = Barotrauma.IO.Path.Combine( 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); 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()); var md5Hash = Md5Hash.BytesAsHash(incrementalHash.GetHashAndReset());
if (logging) if (logging)
@@ -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 v1.0.13.1
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------