Skip to content

Commit 2494fbd

Browse files
committed
ensure packet IDs are uniformly ordered regardless of user locale
1 parent be4d49b commit 2494fbd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Framework/Intersect.Framework.Core/Network/PacketTypeRegistry.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Intersect.Collections;
1+
using System.Globalization;
2+
using Intersect.Collections;
23
using System.Reflection;
34
using Intersect.Framework.Reflection;
45
using Microsoft.Extensions.Logging;
@@ -55,7 +56,10 @@ public bool TryRegisterBuiltIn()
5556
);
5657
}
5758
)
58-
.OrderBy(type => type.ToString());
59+
.OrderBy(
60+
type => type.GetName(qualified: true),
61+
CultureInfo.InvariantCulture.CompareInfo.GetStringComparer(CompareOptions.Ordinal)
62+
);
5963
BuiltInTypesInternal.AddRange(definedPacketTypes);
6064
return BuiltInTypesInternal.All(TryRegister) && BuiltInTypesInternal.Count > 0;
6165
}

0 commit comments

Comments
 (0)