]> git.deb.at Git - rhonda/impostor.git/commitdiff
Update Game Options
authorminiduikboot <mini@duikbo.at>
Tue, 25 Mar 2025 18:48:54 +0000 (19:48 +0100)
committerminiduikboot <mini@duikbo.at>
Sun, 30 Mar 2025 18:34:18 +0000 (20:34 +0200)
Creating a game is now possible

src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs
src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs

index 87b01adcb35ba1df76e9157d1e52114452cb050e..10df4259512568fff2e8eddb6759e7a259dcb3da 100644 (file)
@@ -2,7 +2,7 @@ namespace Impostor.Api.Innersloth.GameOptions;
 
 public class HideNSeekGameOptions : IGameOptions
 {
-    public const int LatestVersion = 8;
+    public const int LatestVersion = 9;
 
     public HideNSeekGameOptions(byte version = LatestVersion)
     {
@@ -93,6 +93,11 @@ public class HideNSeekGameOptions : IGameOptions
 
     public float MaxPingTime { get; set; } = 6f;
 
+    /// <summary>
+    ///     Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert.
+    /// </summary>
+    public byte Tag { get; set; } = 0;
+
     public static HideNSeekGameOptions Deserialize(IMessageReader reader, byte version)
     {
         var options = new HideNSeekGameOptions(version);
@@ -133,6 +138,11 @@ public class HideNSeekGameOptions : IGameOptions
         MaxPingTime = reader.ReadSingle();
         CrewmateTimeInVent = reader.ReadSingle();
 
+        if (Version >= 9)
+        {
+            Tag = reader.ReadByte();
+        }
+
         if (Version > LatestVersion)
         {
             IGameOptions.ThrowUnknownVersion<HideNSeekGameOptions>(Version);
@@ -172,6 +182,11 @@ public class HideNSeekGameOptions : IGameOptions
         writer.Write(MaxPingTime);
         writer.Write(CrewmateTimeInVent);
 
+        if (Version >= 9)
+        {
+            writer.Write((byte)Tag);
+        }
+
         if (Version > LatestVersion)
         {
             IGameOptions.ThrowUnknownVersion<HideNSeekGameOptions>(Version);
index 7095f6de3274b2003dcb384de5addf083c45ae4d..61fdd5f65f1af03381d95dd2c6d4fd056c13c9ce 100644 (file)
@@ -4,7 +4,7 @@ namespace Impostor.Api.Innersloth.GameOptions;
 
 public class NormalGameOptions : IGameOptions
 {
-    public const int LatestVersion = 8;
+    public const int LatestVersion = 9;
 
     public NormalGameOptions(byte version = LatestVersion)
     {
@@ -128,6 +128,11 @@ public class NormalGameOptions : IGameOptions
     /// </summary>
     public TaskBarUpdate TaskBarUpdate { get; set; } = TaskBarUpdate.Always;
 
+    /// <summary>
+    ///     Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert.
+    /// </summary>
+    public byte Tag { get; set; } = 0;
+
     public RoleOptionsCollection RoleOptions { get; set; }
 
     public static NormalGameOptions Deserialize(IMessageReader reader, byte version)
@@ -173,6 +178,11 @@ public class NormalGameOptions : IGameOptions
         AnonymousVotes = reader.ReadBoolean();
         TaskBarUpdate = (TaskBarUpdate)reader.ReadByte();
 
+        if (Version >= 9)
+        {
+            Tag = reader.ReadByte();
+        }
+
         RoleOptions.Deserialize(reader);
 
         if (Version > LatestVersion)
@@ -217,6 +227,11 @@ public class NormalGameOptions : IGameOptions
         writer.Write(AnonymousVotes);
         writer.Write((byte)TaskBarUpdate);
 
+        if (Version >= 9)
+        {
+            writer.Write((byte)Tag);
+        }
+
         RoleOptions.Serialize(writer);
 
         if (Version > LatestVersion)