]> git.deb.at Git - rhonda/impostor.git/commitdiff
Update airship constants
authorjs6pak <kubastaron@hotmail.com>
Fri, 2 Apr 2021 21:44:47 +0000 (23:44 +0200)
committerjs6pak <kubastaron@hotmail.com>
Fri, 2 Apr 2021 22:12:15 +0000 (00:12 +0200)
src/Impostor.Api/Innersloth/ChatType.cs [deleted file]
src/Impostor.Api/Innersloth/Platforms.cs [new file with mode: 0644]
src/Impostor.Api/Innersloth/QuickChatModes.cs [new file with mode: 0644]
src/Impostor.Api/Net/Messages/C2S/Message00HostGameC2S.cs
src/Impostor.Api/Net/Messages/C2S/Message16GetGameListC2S.cs
src/Impostor.Server/Net/Inner/GameDataTag.cs
src/Impostor.Server/Net/Manager/ClientManager.cs
src/Impostor.Server/Net/State/Game.Data.cs

diff --git a/src/Impostor.Api/Innersloth/ChatType.cs b/src/Impostor.Api/Innersloth/ChatType.cs
deleted file mode 100644 (file)
index 087c2b7..0000000
+++ /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 (file)
index 0000000..ab2c0e7
--- /dev/null
@@ -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 (file)
index 0000000..1920264
--- /dev/null
@@ -0,0 +1,8 @@
+namespace Impostor.Api.Innersloth
+{
+    public enum QuickChatModes
+    {
+        FreeChatOrQuickChat = 1,
+        QuickChatOnly = 2,
+    }
+}
index e81e861f65169a1f447a438d9167edf151a8b55e..2a61a1832b9fd1e1b37557d07b31d38d2ae7acc7 100644 (file)
@@ -15,12 +15,12 @@ namespace Impostor.Api.Net.Messages.C2S
         ///     Deserialize a packet.
         /// </summary>
         /// <param name="reader"><see cref="IMessageReader" /> with <see cref="IMessageReader.Tag" /> 0.</param>
-        /// <param name="chatType">The chat type selected in the client of the player.</param>
+        /// <param name="chatMode">The chat type selected in the client of the player.</param>
         /// <returns>Deserialized <see cref="GameOptionsData" />.</returns>
-        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;
         }
index 72be48d7aa24f9a8f1d06573dc802b90cb69a0d7..01237678d4dfb8f9618fe67557c8b9af64db70c1 100644 (file)
@@ -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();
         }
     }
 }
index 818f11ff7bfc6cc53e1db7967d58bfc3bd86a3db..300ce81be39b9e5cf0417153e1fb4833a2fff827 100644 (file)
@@ -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;
     }
 }
index 6ee4515f464f366fa9c95486d26fb0163aa6f281..e7ec17189831717b3590e24f6bdfe3aa5680095a 100644 (file)
@@ -20,7 +20,7 @@ namespace Impostor.Server.Net.Manager
     {
         private static readonly HashSet<int> SupportedVersions = new HashSet<int>
         {
-            GameVersion.GetVersion(2021, 3, 5), // 2021.3.5
+            GameVersion.GetVersion(2021, 3, 25), // 2021.3.31s
         };
 
         private static readonly string ServerBrand = $"Impostor {DotnetUtils.GetVersion()}";
index 250c3078d81f5b6d28f2983810d6cf716df0addf..9680768147e86b648d1334128cdc74afbb26578c 100644 (file)
@@ -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;
                             }