From cb7160d5d625976823da9ee8e4437e6e26b6ba19 Mon Sep 17 00:00:00 2001 From: NikoCat233 Date: Sun, 15 Nov 2026 20:05:47 +0800 Subject: [PATCH] fix: read and write Xbox platform IDs for Win10 clients (#750) --- src/Impostor.Api/Innersloth/PlatformSpecificData.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Impostor.Api/Innersloth/PlatformSpecificData.cs b/src/Impostor.Api/Innersloth/PlatformSpecificData.cs index ac3954f6..de1e9d41 100644 --- a/src/Impostor.Api/Innersloth/PlatformSpecificData.cs +++ b/src/Impostor.Api/Innersloth/PlatformSpecificData.cs @@ -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"));