diff --git a/src/Impostor.Api/Innersloth/Platforms.cs b/src/Impostor.Api/Innersloth/Platforms.cs new file mode 100644 index 00000000..ab2c0e74 --- /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 087c2b7c..19202647 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 e81e861f..2a61a183 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 72be48d7..01237678 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 818f11ff..300ce81b 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 6ee4515f..e7ec1718 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 250c3078..96807681 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; }