v1.0.13.1 (first post-1.0 patch)

This commit is contained in:
Regalis11
2023-05-10 15:07:17 +03:00
parent 96fb49ba14
commit ee1db852b1
272 changed files with 5738 additions and 2413 deletions
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
@@ -22,7 +23,7 @@ namespace Barotrauma
: string.Empty);
}
public static readonly Version MinimumHashCompatibleVersion = new Version(0, 18, 13, 0);
public static readonly Version MinimumHashCompatibleVersion = new Version(1, 0, 11, 0);
public const string LocalModsDir = "LocalMods";
public static readonly string WorkshopModsDir = Barotrauma.IO.Path.Combine(
@@ -203,7 +204,13 @@ namespace Barotrauma
break;
}
}
if (UgcId.TryUnwrap(out ContentPackageId? id) && id != null)
{
incrementalHash.AppendData(Encoding.UTF8.GetBytes(id.StringRepresentation));
}
incrementalHash.AppendData(Encoding.UTF8.GetBytes(ModVersion));
var md5Hash = Md5Hash.BytesAsHash(incrementalHash.GetHashAndReset());
if (logging)
{
@@ -116,9 +116,12 @@ namespace Barotrauma
public static void ThrowIfDuplicates(IEnumerable<ContentPackage> pkgs)
{
var contentPackages = pkgs as IList<ContentPackage> ?? pkgs.ToArray();
if (contentPackages.Any(p1 => contentPackages.AtLeast(2, p2 => p1 == p2)))
foreach (ContentPackage cp in contentPackages)
{
throw new InvalidOperationException($"Input contains duplicate packages");
if (contentPackages.AtLeast(2, cp2 => cp == cp2))
{
throw new InvalidOperationException($"There are duplicates in the list of selected content packages (\"{cp.Name}\", hash: {cp.Hash?.ShortRepresentation ?? "none"})");
}
}
}