From: js6pak Date: Fri, 2 Apr 2021 21:44:47 +0000 (+0200) Subject: Update airship constants X-Git-Tag: v1.4.0~14^2~18 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=11e87e51db522e8d01ac889053eff98680957a75;p=rhonda%2Fimpostor.git Update airship constants --- diff --git a/src/Impostor.Api/Innersloth/ChatType.cs b/src/Impostor.Api/Innersloth/ChatType.cs deleted file mode 100644 index 087c2b7..0000000 --- a/src/Impostor.Api/Innersloth/ChatType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Impostor.Api.Innersloth -{ - public enum ChatType - { - FreeChatOrQuickChat = 1, - QuickChatOnly = 2, - } -} 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/QuickChatModes.cs b/src/Impostor.Api/Innersloth/QuickChatModes.cs new file mode 100644 index 0000000..1920264 --- /dev/null +++ b/src/Impostor.Api/Innersloth/QuickChatModes.cs @@ -0,0 +1,8 @@ +namespace Impostor.Api.Innersloth +{ + 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; }