fix: read and write Xbox platform IDs for Win10 clients (#750)

This commit is contained in:
NikoCat233 authored and GitHub committed 2026-11-15 13:05:47 +01:00
1 parent c73a0ea044
commit cb7160d5d6
1 file changed
+3 -2
@@ -17,7 +17,7 @@ namespace Impostor.Api.Innersloth
Platform = (Platforms)reader.Tag;
PlatformName = reader.ReadString();
XboxPlatformId = Platform == Platforms.Xbox ? reader.ReadUInt64() : null;
XboxPlatformId = Platform is Platforms.StandaloneWin10 or Platforms.Xbox ? reader.ReadUInt64() : null;
PsnPlatformId = Platform == Platforms.Playstation ? reader.ReadUInt64() : null;
}
@@ -35,8 +35,9 @@ namespace Impostor.Api.Innersloth
writer.Write(PlatformName);
switch (Platform)
{
case Platforms.StandaloneWin10:
case Platforms.Xbox:
writer.Write(XboxPlatformId ?? throw new NullReferenceException($"{nameof(XboxPlatformId)} shouldn't be null when {nameof(Platform)} is Xbox"));
writer.Write(XboxPlatformId ?? throw new NullReferenceException($"{nameof(XboxPlatformId)} shouldn't be null when {nameof(Platform)} is {Platform}"));
break;
case Platforms.Playstation:
writer.Write(PsnPlatformId ?? throw new NullReferenceException($"{nameof(PsnPlatformId)} shouldn't be null when {nameof(Platform)} is Playstation"));