]> git.deb.at Git - rhonda/impostor.git/commitdiff
Support New HideNSeekGameOptions
authorlinmeideli <2558527373@qq.com>
Wed, 19 Aug 2026 03:10:53 +0000 (11:10 +0800)
committerminiduikboot <mini@duikbo.at>
Sun, 30 Aug 2026 16:48:37 +0000 (18:48 +0200)
src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs

index 74b3fd1eef02d5745ee912419485a27c77d749be..457ba1661c6831872a99b03c34aeb630de21ba1f 100644 (file)
@@ -2,7 +2,7 @@ namespace Impostor.Api.Innersloth.GameOptions;
 
 public class HideNSeekGameOptions : IGameOptions
 {
-    public const int LatestVersion = 10;
+    public const int LatestVersion = 11;
 
     public HideNSeekGameOptions(byte version = LatestVersion)
     {
@@ -107,6 +107,11 @@ public class HideNSeekGameOptions : IGameOptions
 
     public void Deserialize(IMessageReader reader)
     {
+        if (Version > LatestVersion)
+        {
+            IGameOptions.ThrowUnknownVersion<HideNSeekGameOptions>(Version);
+        }
+
         if (Version >= 8)
         {
             SpecialMode = (SpecialGameModes)reader.ReadByte();
@@ -142,11 +147,6 @@ public class HideNSeekGameOptions : IGameOptions
         {
             Tag = (GameTags)reader.ReadByte();
         }
-
-        if (Version > LatestVersion)
-        {
-            IGameOptions.ThrowUnknownVersion<HideNSeekGameOptions>(Version);
-        }
     }
 
     public void Serialize(IMessageWriter writer)