From 11e87e51db522e8d01ac889053eff98680957a75 Mon Sep 17 00:00:00 2001 From: js6pak Date: Fri, 2 Apr 2021 23:44:47 +0200 Subject: [PATCH] Update airship constants --- src/Impostor.Api/Innersloth/Platforms.cs | 15 +++++++++++++++ .../Innersloth/{ChatType.cs => QuickChatModes.cs} | 2 +- .../Net/Messages/C2S/Message00HostGameC2S.cs | 6 +++--- .../Net/Messages/C2S/Message16GetGameListC2S.cs | 4 ++-- src/Impostor.Server/Net/Inner/GameDataTag.cs | 3 ++- src/Impostor.Server/Net/Manager/ClientManager.cs | 2 +- src/Impostor.Server/Net/State/Game.Data.cs | 4 ++-- 7 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 src/Impostor.Api/Innersloth/Platforms.cs rename src/Impostor.Api/Innersloth/{ChatType.cs => QuickChatModes.cs} (78%) diff --git a/src/Impostor.Api/Innersloth/Platforms.cs b/src/Impostor.Api/Innersloth/Platforms.cs new file mode 100644 index 0000000..ab2c0e7 --- /dev/null +++ b/src/Impostor.Api/Innersloth/Platforms.cs @@ -0,0 +1,15 @@ +namespace Impostor.Api.Innersloth +{ + public enum Platforms + { + Unknown, + StandaloneEpicPC, + StandaloneSteamPC, + StandaloneMac, + StandaloneWin10, + StandaloneItch, + IPhone, + Android, + Switch, + } +} diff --git a/src/Impostor.Api/Innersloth/ChatType.cs b/src/Impostor.Api/Innersloth/QuickChatModes.cs similarity index 78% rename from src/Impostor.Api/Innersloth/ChatType.cs rename to src/Impostor.Api/Innersloth/QuickChatModes.cs index 087c2b7..1920264 100644 --- a/src/Impostor.Api/Innersloth/ChatType.cs +++ b/src/Impostor.Api/Innersloth/QuickChatModes.cs @@ -1,6 +1,6 @@ namespace Impostor.Api.Innersloth { - public enum ChatType + public enum QuickChatModes { FreeChatOrQuickChat = 1, QuickChatOnly = 2, diff --git a/src/Impostor.Api/Net/Messages/C2S/Message00HostGameC2S.cs b/src/Impostor.Api/Net/Messages/C2S/Message00HostGameC2S.cs index e81e861..2a61a18 100644 --- a/src/Impostor.Api/Net/Messages/C2S/Message00HostGameC2S.cs +++ b/src/Impostor.Api/Net/Messages/C2S/Message00HostGameC2S.cs @@ -15,12 +15,12 @@ namespace Impostor.Api.Net.Messages.C2S /// Deserialize a packet. /// /// with 0. - /// The chat type selected in the client of the player. + /// The chat type selected in the client of the player. /// Deserialized . - public static GameOptionsData Deserialize(IMessageReader reader, out ChatType chatType) + public static GameOptionsData Deserialize(IMessageReader reader, out QuickChatModes chatMode) { var gameOptionsData = GameOptionsData.DeserializeCreate(reader); - chatType = (ChatType)reader.ReadByte(); + chatMode = (QuickChatModes)reader.ReadByte(); return gameOptionsData; } diff --git a/src/Impostor.Api/Net/Messages/C2S/Message16GetGameListC2S.cs b/src/Impostor.Api/Net/Messages/C2S/Message16GetGameListC2S.cs index 72be48d..0123767 100644 --- a/src/Impostor.Api/Net/Messages/C2S/Message16GetGameListC2S.cs +++ b/src/Impostor.Api/Net/Messages/C2S/Message16GetGameListC2S.cs @@ -10,11 +10,11 @@ namespace Impostor.Api.Net.Messages.C2S throw new NotImplementedException(); } - public static void Deserialize(IMessageReader reader, out GameOptionsData options, out ChatType chatType) + public static void Deserialize(IMessageReader reader, out GameOptionsData options, out QuickChatModes chatMode) { reader.ReadPackedInt32(); // Hardcoded 0. options = GameOptionsData.DeserializeCreate(reader); - chatType = (ChatType)reader.ReadByte(); + chatMode = (QuickChatModes)reader.ReadByte(); } } } diff --git a/src/Impostor.Server/Net/Inner/GameDataTag.cs b/src/Impostor.Server/Net/Inner/GameDataTag.cs index 818f11f..300ce81 100644 --- a/src/Impostor.Server/Net/Inner/GameDataTag.cs +++ b/src/Impostor.Server/Net/Inner/GameDataTag.cs @@ -9,6 +9,7 @@ public const byte SceneChangeFlag = 6; public const byte ReadyFlag = 7; public const byte ChangeSettingsFlag = 8; - public const byte ClientInfoFlag = 205; + public const byte ConsoleDeclareClientPlatformFlag = 205; + public const byte PS4RoomRequest = 206; } } diff --git a/src/Impostor.Server/Net/Manager/ClientManager.cs b/src/Impostor.Server/Net/Manager/ClientManager.cs index 6ee4515..e7ec171 100644 --- a/src/Impostor.Server/Net/Manager/ClientManager.cs +++ b/src/Impostor.Server/Net/Manager/ClientManager.cs @@ -20,7 +20,7 @@ namespace Impostor.Server.Net.Manager { private static readonly HashSet SupportedVersions = new HashSet { - GameVersion.GetVersion(2021, 3, 5), // 2021.3.5 + GameVersion.GetVersion(2021, 3, 25), // 2021.3.31s }; private static readonly string ServerBrand = $"Impostor {DotnetUtils.GetVersion()}"; diff --git a/src/Impostor.Server/Net/State/Game.Data.cs b/src/Impostor.Server/Net/State/Game.Data.cs index 250c307..9680768 100644 --- a/src/Impostor.Server/Net/State/Game.Data.cs +++ b/src/Impostor.Server/Net/State/Game.Data.cs @@ -254,14 +254,14 @@ namespace Impostor.Server.Net.State break; } - case GameDataTag.ClientInfoFlag: + case GameDataTag.ConsoleDeclareClientPlatformFlag: { var clientId = reader.ReadPackedInt32(); var platform = (RuntimePlatform)reader.ReadPackedInt32(); if (clientId != sender.Client.Id) { - if (await sender.Client.ReportCheatAsync(new CheatContext(nameof(GameDataTag.ClientInfoFlag)), "Client sent info with wrong client id")) + if (await sender.Client.ReportCheatAsync(new CheatContext(nameof(GameDataTag.ConsoleDeclareClientPlatformFlag)), "Client sent info with wrong client id")) { return false; } -- 2.39.5