]> git.deb.at Git - rhonda/impostor.git/commitdiff
Support latest Among Us beta
authorAeonLucid <aeonlucid@outlook.com>
Sun, 25 Oct 2020 01:23:37 +0000 (03:23 +0200)
committerAeonLucid <aeonlucid@outlook.com>
Sun, 25 Oct 2020 01:23:37 +0000 (03:23 +0200)
src/Impostor.Api/Innersloth/GameOptionsData.cs
src/Impostor.Api/Innersloth/TaskBarUpdate.cs [new file with mode: 0644]

index f58f19170a5ac57f36f570832a26449af0d0de87..9bb30cd20a29eeeb1df0075998b12ca9bb39c7eb 100644 (file)
@@ -48,6 +48,10 @@ namespace Impostor.Api.Innersloth
 
         public bool VisualTasks { get; set; }
 
+        public bool AnonymousVotes { get; set; }
+
+        public TaskBarUpdate TaskBarUpdate { get; set; }
+
         public bool IsDefaults { get; set; }
 
         public void Serialize(BinaryWriter writer, byte version)
@@ -82,6 +86,12 @@ namespace Impostor.Api.Innersloth
             }
 
             if (Version > 3)
+            {
+                writer.Write((bool)AnonymousVotes);
+                writer.Write((byte)TaskBarUpdate);
+            }
+
+            if (Version > 4)
             {
                 throw new ImpostorException($"Unknown GameOptionsData version {Version}.");
             }
@@ -126,6 +136,12 @@ namespace Impostor.Api.Innersloth
             }
 
             if (Version > 3)
+            {
+                AnonymousVotes = bytes.ReadBoolean();
+                TaskBarUpdate = (TaskBarUpdate)bytes.ReadByte();
+            }
+
+            if (Version > 4)
             {
                 throw new ImpostorException($"Unknown GameOptionsData version {Version}.");
             }
diff --git a/src/Impostor.Api/Innersloth/TaskBarUpdate.cs b/src/Impostor.Api/Innersloth/TaskBarUpdate.cs
new file mode 100644 (file)
index 0000000..f4d7c1f
--- /dev/null
@@ -0,0 +1,9 @@
+namespace Impostor.Api.Innersloth
+{
+    public enum TaskBarUpdate : byte
+    {
+        Always = 0,
+        Meetings = 1,
+        Never = 2
+    }
+}
\ No newline at end of file