From: miniduikboot Date: Tue, 25 Mar 2025 18:48:54 +0000 (+0100) Subject: Update Game Options X-Git-Tag: v1.10.3~11^2~8 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=3e2c3f152534a0e160f4a480d6694dc6776eca37;p=rhonda%2Fimpostor.git Update Game Options Creating a game is now possible --- diff --git a/src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs b/src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs index 87b01ad..10df425 100644 --- a/src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs +++ b/src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs @@ -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; + /// + /// Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert. + /// + 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(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(Version); diff --git a/src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs b/src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs index 7095f6d..61fdd5f 100644 --- a/src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs +++ b/src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs @@ -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 /// public TaskBarUpdate TaskBarUpdate { get; set; } = TaskBarUpdate.Always; + /// + /// Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert. + /// + 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)