diff --git a/src/Empostor.Api/Innersloth/PlatformSpecificData.cs b/src/Empostor.Api/Innersloth/PlatformSpecificData.cs index acbb71e..4323bdf 100644 --- a/src/Empostor.Api/Innersloth/PlatformSpecificData.cs +++ b/src/Empostor.Api/Innersloth/PlatformSpecificData.cs @@ -17,7 +17,7 @@ namespace Empostor.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 Empostor.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")); diff --git a/src/Empostor.Server/Net/Inner/GameDataTag.cs b/src/Empostor.Server/Net/Inner/GameDataTag.cs index 22e7903..4334052 100644 --- a/src/Empostor.Server/Net/Inner/GameDataTag.cs +++ b/src/Empostor.Server/Net/Inner/GameDataTag.cs @@ -1,4 +1,6 @@ -namespace Empostor.Server.Net.Inner +using System.Collections.Generic; + +namespace Empostor.Server.Net.Inner { public static class GameDataTag { @@ -11,5 +13,20 @@ public const byte ChangeSettingsFlag = 8; public const byte ConsoleDeclareClientPlatformFlag = 205; public const byte PS4RoomRequest = 206; + public const byte XboxDeclareXuid = 207; + + public static readonly HashSet ValidTags = new() + { + DataFlag, + RpcFlag, + SpawnFlag, + DespawnFlag, + SceneChangeFlag, + ReadyFlag, + ChangeSettingsFlag, + ConsoleDeclareClientPlatformFlag, + PS4RoomRequest, + XboxDeclareXuid, + }; } } diff --git a/src/Empostor.Server/Net/State/Game.Data.cs b/src/Empostor.Server/Net/State/Game.Data.cs index 34efc7a..8ccdaef 100644 --- a/src/Empostor.Server/Net/State/Game.Data.cs +++ b/src/Empostor.Server/Net/State/Game.Data.cs @@ -383,6 +383,12 @@ namespace Empostor.Server.Net.State default: { + if (GameDataTag.ValidTags.Contains(reader.Tag)) + { + _logger.LogDebug("{Code} - Get vanilla GameData tag {Tag} that isn't handled.", Code, reader.Tag); + return GameDataResult.Continue; + } + _logger.LogWarning("{Code} - Bad GameData tag {Tag}", Code, reader.Tag); if (await sender.Client.ReportCheatAsync(