Release 1.10.7.2 - Autumn Update 2025 Hotfix 4

This commit is contained in:
Regalis11
2025-10-22 14:54:03 +03:00
parent 37ffc94551
commit 7e25111487
17 changed files with 315 additions and 83 deletions
@@ -63,6 +63,9 @@ namespace Barotrauma
public HashSet<string> RequiredContentPackages = new HashSet<string>();
public const int MaxNameLength = 30;
public const int MaxDescriptionLength = 500;
public string Name
{
get;
@@ -181,6 +181,8 @@ namespace Barotrauma.Networking
abstract partial class NetworkMember
{
protected const int MaxSubNameLengthInErrorMessages = 16;
public UInt16 LastClientListUpdateID
{
get;
@@ -1874,5 +1874,24 @@ namespace Barotrauma
}
return true;
}
/// <summary>
/// Normalizes a string by replacing all homoglyph characters with their ASCII equivalents.
/// This allows for efficient homoglyph-aware string comparisons using standard string operations.
/// </summary>
public static string Normalize(string input)
{
if (string.IsNullOrEmpty(input)) { return input; }
var normalized = new char[input.Length];
for (int i = 0; i < input.Length; i++)
{
uint charCode = (uint)input[i];
uint[] glyphGroup = homoglyphs.Find(g => g.Contains(charCode));
// The first element in each homoglyph group is the canonical ASCII character
normalized[i] = glyphGroup != null ? (char)glyphGroup[0] : input[i];
}
return new string(normalized);
}
}
}
@@ -11,7 +11,9 @@ namespace Barotrauma
{
public class Md5Hash
{
public static readonly Md5Hash Blank = new Md5Hash(new string('0', 32));
public const int MaxHashLength = 32;
public static readonly Md5Hash Blank = new Md5Hash(new string('0', MaxHashLength));
private static string RemoveWhitespace(string s)
{