From a63fc400993813bc4163c88550fd096c99efe0b8 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Wed, 31 Mar 2021 21:49:51 +0200 Subject: [PATCH 01/12] Gamedata packets are now have initial state false I managed to get into a lobby with this --- src/Impostor.Server/Net/Inner/Objects/InnerGameData.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerGameData.cs b/src/Impostor.Server/Net/Inner/Objects/InnerGameData.cs index d6a16fdad..a1f56ed50 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerGameData.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerGameData.cs @@ -75,7 +75,8 @@ public override async ValueTask DeserializeAsync(IClientPlayer sender, IClientPl } else { - throw new NotImplementedException("This shouldn't happen, according to Among Us disassembly."); + // It'll send an message per dirty player + // throw new NotImplementedException("This shouldn't happen, according to Among Us disassembly."); } } From 92e3506f5119b2de786639e6c64d2ecfefbac4a6 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Wed, 31 Mar 2021 23:22:56 +0200 Subject: [PATCH 02/12] First attempt at getting some airship stuff online --- src/Impostor.Api/Innersloth/MapTypes.cs | 1 + src/Impostor.Api/Innersloth/SystemTypes.cs | 34 ++++++++++++++++++++++ src/Impostor.Server/Net/State/Game.Data.cs | 1 + 3 files changed, 36 insertions(+) diff --git a/src/Impostor.Api/Innersloth/MapTypes.cs b/src/Impostor.Api/Innersloth/MapTypes.cs index 2706933aa..5de0adb65 100644 --- a/src/Impostor.Api/Innersloth/MapTypes.cs +++ b/src/Impostor.Api/Innersloth/MapTypes.cs @@ -5,5 +5,6 @@ public enum MapTypes : byte Skeld = 0, MiraHQ = 1, Polus = 2, + Airship = 4, } } diff --git a/src/Impostor.Api/Innersloth/SystemTypes.cs b/src/Impostor.Api/Innersloth/SystemTypes.cs index 6a072e771..74affbfd1 100644 --- a/src/Impostor.Api/Innersloth/SystemTypes.cs +++ b/src/Impostor.Api/Innersloth/SystemTypes.cs @@ -67,5 +67,39 @@ public enum SystemTypes : byte Specimens = 28, BoilerRoom = 29, + + VaultRoom = 30, + + Cockpit = 31, + + Armory = 32, + + Kitchen = 33, + + ViewingDeck = 34, + + HallOfPortraits = 35, + + CargoBay = 36, + + Ventilation = 37, + + Showers = 38, + + Engine = 39, + + Brig = 40, + + MeetingRoom = 41, + + Records = 42, + + Lounge = 43, + + GapRoom = 44, + + MainHall = 45, + + Medical = 46, } } diff --git a/src/Impostor.Server/Net/State/Game.Data.cs b/src/Impostor.Server/Net/State/Game.Data.cs index 968076814..e69147086 100644 --- a/src/Impostor.Server/Net/State/Game.Data.cs +++ b/src/Impostor.Server/Net/State/Game.Data.cs @@ -40,6 +40,7 @@ internal partial class Game typeof(InnerShipStatus), // HeadQuarters typeof(InnerShipStatus), // PlanetMap typeof(InnerShipStatus), // AprilShipStatus + typeof(InnerShipStatus), // Airship }; private readonly List _allObjects = new List(); From d31115096755c9b1cef72dae0aa9773ff64f995f Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Thu, 1 Apr 2021 16:57:34 +0200 Subject: [PATCH 03/12] API: update enums for airship --- src/Impostor.Api/Innersloth/MapSpawn.cs | 1 + src/Impostor.Api/Net/Inner/RpcCalls.cs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Impostor.Api/Innersloth/MapSpawn.cs b/src/Impostor.Api/Innersloth/MapSpawn.cs index 61dea0f6d..3f59f0a8f 100644 --- a/src/Impostor.Api/Innersloth/MapSpawn.cs +++ b/src/Impostor.Api/Innersloth/MapSpawn.cs @@ -18,6 +18,7 @@ private MapSpawn(float spawnRadius, Vector2 initialSpawnCenter, Vector2 meetingS [MapTypes.Skeld] = new MapSpawn(1.6f, new Vector2(-0.72f, 0.62f), new Vector2(-0.72f, 0.62f)), [MapTypes.MiraHQ] = new MapSpawn(1.55f, new Vector2(-4.4f, 2.2f), new Vector2(24.043f, 1.72f)), [MapTypes.Polus] = new MapSpawn(1f, new Vector2(16.64f, -2.46f), new Vector2(17.726f, -16.286f)), + [MapTypes.Airship] = new MapSpawn(0f, new Vector2(-0.66f, -0.5f), new Vector2(-0.66f, -0.5f)), }; public float SpawnRadius { get; } diff --git a/src/Impostor.Api/Net/Inner/RpcCalls.cs b/src/Impostor.Api/Net/Inner/RpcCalls.cs index 506017d1a..6176d3c67 100644 --- a/src/Impostor.Api/Net/Inner/RpcCalls.cs +++ b/src/Impostor.Api/Net/Inner/RpcCalls.cs @@ -1,4 +1,4 @@ -namespace Impostor.Server.Net.Inner +namespace Impostor.Server.Net.Inner { public enum RpcCalls : byte { @@ -33,5 +33,7 @@ public enum RpcCalls : byte RepairSystem = 28, SetTasks = 29, UpdateGameData = 30, + ClimbLadder = 31, + UsePlatform = 32, } } From 4c1bd4a57813bbf81afab6afeefa6304e568040b Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Thu, 1 Apr 2021 17:49:41 +0200 Subject: [PATCH 04/12] editorconfig: Don't indent blocks in case contents This is more in line with the existing codebase --- src/.editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.editorconfig b/src/.editorconfig index 38c708527..88f363eae 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -171,7 +171,7 @@ csharp_new_line_between_query_expression_clauses = true csharp_indent_block_contents = true csharp_indent_braces = false csharp_indent_case_contents = true -csharp_indent_case_contents_when_block = true +csharp_indent_case_contents_when_block = false csharp_indent_switch_labels = true csharp_indent_labels = flush_left From 16a2b0aac658a1c80a9d9933d95d5088728619b6 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Thu, 1 Apr 2021 18:16:04 +0200 Subject: [PATCH 05/12] I counted the doors on Airship and I hope I counted correctly --- .../Net/Inner/Objects/Systems/ShipStatus/DoorsSystemType.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/DoorsSystemType.cs b/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/DoorsSystemType.cs index df374bff6..03ba1df92 100644 --- a/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/DoorsSystemType.cs +++ b/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/DoorsSystemType.cs @@ -18,6 +18,7 @@ public DoorsSystemType(IGame game) MapTypes.Skeld => 13, MapTypes.MiraHQ => 2, MapTypes.Polus => 12, + MapTypes.Airship => 21, // TODO do the toilet doors count? 21 yes, 17 no _ => throw new ArgumentOutOfRangeException(), }; From d5ae007d1c0af4cc883fb6a64810bbac6680ea07 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Fri, 2 Apr 2021 00:41:19 +0200 Subject: [PATCH 06/12] implement rpc 31: climb ladder --- .../Net/Messages/Rpcs/Rpc31ClimbLadder.cs | 17 +++++++++++++++++ .../Objects/Components/InnerPlayerPhysics.cs | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 src/Impostor.Api/Net/Messages/Rpcs/Rpc31ClimbLadder.cs diff --git a/src/Impostor.Api/Net/Messages/Rpcs/Rpc31ClimbLadder.cs b/src/Impostor.Api/Net/Messages/Rpcs/Rpc31ClimbLadder.cs new file mode 100644 index 000000000..a31522167 --- /dev/null +++ b/src/Impostor.Api/Net/Messages/Rpcs/Rpc31ClimbLadder.cs @@ -0,0 +1,17 @@ +namespace Impostor.Api.Net.Messages.Rpcs +{ + public static class Rpc31ClimbLadder + { + public static void Serialize(IMessageWriter writer, byte ladderId, byte lastClimbLadderSid) + { + writer.Write(ladderId); + writer.Write(lastClimbLadderSid); + } + + public static void Deserialize(IMessageReader reader, out byte ladderId, out byte lastClimbLadderSid) + { + ladderId = reader.ReadByte(); + lastClimbLadderSid = reader.ReadByte(); + } + } +} diff --git a/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs b/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs index 14e8690c7..19d4dd504 100644 --- a/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs +++ b/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs @@ -55,6 +55,10 @@ public override async ValueTask HandleRpcAsync(ClientPlayer sender, Client Rpc19EnterVent.Deserialize(reader, out ventId); break; + case RpcCalls.ClimbLadder: + Rpc31ClimbLadder.Deserialize(reader, out byte ladderId, out byte lastClimbLadderSid); + return true; + default: return await UnregisteredCall(call, sender); } From c01062ed65cf93e81e56080d6872b6b73e523fc2 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Fri, 2 Apr 2021 00:42:26 +0200 Subject: [PATCH 07/12] implement rpc 32: use platform --- .../Net/Messages/Rpcs/Rpc32UsePlatform.cs | 13 +++++++++++++ .../Net/Inner/Objects/InnerPlayerControl.cs | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/Impostor.Api/Net/Messages/Rpcs/Rpc32UsePlatform.cs diff --git a/src/Impostor.Api/Net/Messages/Rpcs/Rpc32UsePlatform.cs b/src/Impostor.Api/Net/Messages/Rpcs/Rpc32UsePlatform.cs new file mode 100644 index 000000000..9344be201 --- /dev/null +++ b/src/Impostor.Api/Net/Messages/Rpcs/Rpc32UsePlatform.cs @@ -0,0 +1,13 @@ +namespace Impostor.Api.Net.Messages.Rpcs +{ + public static class Rpc32UsePlatform + { + public static void Serialize(IMessageWriter writer) + { + } + + public static void Deserialize(IMessageReader reader) + { + } + } +} diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs index 7bbf8e78a..49e069baf 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs @@ -285,6 +285,17 @@ public override async ValueTask HandleRpcAsync(ClientPlayer sender, Client return await HandleSetStartCounter(sender, sequenceId, startCounter); } + case RpcCalls.UsePlatform: + { + if (!await ValidateOwnership(call, sender)) + { + return false; + } + + Rpc32UsePlatform.Deserialize(reader); + break; + } + default: return await UnregisteredCall(call, sender); } From 66c2434320077130b47ec6512d372e25e2178caa Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Fri, 2 Apr 2021 22:42:15 +0200 Subject: [PATCH 08/12] Implement HeliSabotageSystemType It works, although I'm not completely sure why. --- .../Net/Inner/Objects/InnerShipStatus.cs | 2 +- .../ShipStatus/HeliSabotageSystemType.cs | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs b/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs index d51c0b8d2..575a64ac2 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs @@ -29,7 +29,7 @@ public InnerShipStatus(ILogger logger, Game game) { [SystemTypes.Electrical] = new SwitchSystem(), [SystemTypes.MedBay] = new MedScanSystem(), - [SystemTypes.Reactor] = new ReactorSystemType(), + [SystemTypes.Reactor] = game.Options.Map == MapTypes.Airship ? new HeliSabotageSystemType() : new ReactorSystemType(), [SystemTypes.LifeSupp] = new LifeSuppSystemType(), [SystemTypes.Security] = new SecurityCameraSystemType(), [SystemTypes.Comms] = new HudOverrideSystemType(), diff --git a/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs b/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs new file mode 100644 index 000000000..f29c4b8df --- /dev/null +++ b/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using Impostor.Api.Net.Messages; +using Microsoft.Extensions.Logging; + +namespace Impostor.Server.Net.Inner.Objects.Systems.ShipStatus +{ + public class HeliSabotageSystemType : ISystemType, IActivatable + { + public HeliSabotageSystemType() + { + Countdown = 10000f; + ActiveConsoles = new HashSet>(); + CompletedConsoles = new HashSet(); + } + + public float Countdown { get; private set; } + + public float Timer { get; private set; } + + public HashSet> ActiveConsoles { get; } + + public HashSet CompletedConsoles { get; } + + public bool IsActive => Countdown < 10000.0; + + public void Serialize(IMessageWriter writer, bool initialState) + { + throw new NotImplementedException(); + } + + public void Deserialize(IMessageReader reader, bool initialState) + { + // TODO: Find out what these 2 bytes are used for + _ = reader.ReadByte(); + _ = reader.ReadByte(); + Countdown = reader.ReadSingle(); + Timer = reader.ReadSingle(); + ActiveConsoles.Clear(); // TODO: Thread safety + CompletedConsoles.Clear(); // TODO: Thread safety + + var count = reader.ReadPackedUInt32(); + + for (var i = 0; i < count; i++) + { + ActiveConsoles.Add(new Tuple(reader.ReadByte(), reader.ReadByte())); + } + + var count2 = reader.ReadPackedUInt32(); + + for (var i = 0; i < count2; i++) + { + CompletedConsoles.Add(reader.ReadByte()); + } + } + } +} From 47aebe7b7b564893efa42bea96fe09eac3a412f6 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Sat, 3 Apr 2021 00:08:51 +0200 Subject: [PATCH 09/12] Fix InnerShipStatus deserializing 3.31 now distributes them as multiple messages This also explains the two weird bytes in HeliSabotage, so these can be removed too --- .../Net/Inner/Objects/InnerShipStatus.cs | 28 ++++--------------- .../ShipStatus/HeliSabotageSystemType.cs | 3 -- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs b/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs index 575a64ac2..c571c5a31 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs @@ -56,31 +56,13 @@ public override async ValueTask DeserializeAsync(IClientPlayer sender, IClientPl return; } - if (initialState) + while (reader.Position < reader.Length) { - // TODO: (_systems[SystemTypes.Doors] as DoorsSystemType).SetDoors(); - foreach (var systemType in SystemTypeHelpers.AllTypes) + IMessageReader msgReader = reader.ReadMessage(); + SystemTypes type = (SystemTypes)msgReader.Tag; + if (_systems.TryGetValue(type, out var value)) { - if (_systems.TryGetValue(systemType, out var system)) - { - system.Deserialize(reader, true); - } - } - } - else - { - var count = reader.ReadPackedUInt32(); - - foreach (var systemType in SystemTypeHelpers.AllTypes) - { - // TODO: Not sure what is going on here, check. - if ((count & 1 << (int)(systemType & (SystemTypes.ShipTasks | SystemTypes.Doors))) != 0L) - { - if (_systems.TryGetValue(systemType, out var system)) - { - system.Deserialize(reader, false); - } - } + value.Deserialize(msgReader, initialState); } } } diff --git a/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs b/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs index f29c4b8df..22a2a22d5 100644 --- a/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs +++ b/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs @@ -31,9 +31,6 @@ public void Serialize(IMessageWriter writer, bool initialState) public void Deserialize(IMessageReader reader, bool initialState) { - // TODO: Find out what these 2 bytes are used for - _ = reader.ReadByte(); - _ = reader.ReadByte(); Countdown = reader.ReadSingle(); Timer = reader.ReadSingle(); ActiveConsoles.Clear(); // TODO: Thread safety From 7fd68e31e6e2f6713b4c58525a9beada56424bef Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Sat, 3 Apr 2021 00:37:12 +0200 Subject: [PATCH 10/12] Fix Docker container build --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e8797a7c4..ae6b0706e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ WORKDIR /source # Copy csproj and restore. COPY src/Impostor.Server/Impostor.Server.csproj ./src/Impostor.Server/Impostor.Server.csproj COPY src/Impostor.Api/Impostor.Api.csproj ./src/Impostor.Api/Impostor.Api.csproj -COPY src/Impostor.Hazel/Impostor.Hazel.csproj ./src/Impostor.Hazel/Impostor.Hazel.csproj +COPY src/Impostor.Hazel/Hazel/Hazel.csproj ./src/Impostor.Hazel/Hazel/Hazel.csproj RUN case "$TARGETARCH" in \ amd64) NETCORE_PLATFORM='linux-x64';; \ @@ -21,7 +21,7 @@ RUN case "$TARGETARCH" in \ esac && \ dotnet restore -r "$NETCORE_PLATFORM" ./src/Impostor.Server/Impostor.Server.csproj && \ dotnet restore -r "$NETCORE_PLATFORM" ./src/Impostor.Api/Impostor.Api.csproj && \ - dotnet restore -r "$NETCORE_PLATFORM" ./src/Impostor.Hazel/Impostor.Hazel.csproj + dotnet restore -r "$NETCORE_PLATFORM" ./src/Impostor.Hazel/Hazel/Hazel.csproj # Copy everything else. COPY src/. ./src/ From 441d9c300c67bd134fc23b8672a3aa1900245544 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Sat, 3 Apr 2021 00:46:34 +0200 Subject: [PATCH 11/12] Move PlayerVentEvent call to applicable RPC's --- .../Net/Inner/Objects/Components/InnerPlayerPhysics.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs b/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs index 19d4dd504..ce93dbb02 100644 --- a/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs +++ b/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs @@ -49,22 +49,22 @@ public override async ValueTask HandleRpcAsync(ClientPlayer sender, Client { case RpcCalls.EnterVent: Rpc19EnterVent.Deserialize(reader, out ventId); + await _eventManager.CallAsync(new PlayerVentEvent(_game, sender, _playerControl, (VentLocation)ventId, true)); break; case RpcCalls.ExitVent: Rpc19EnterVent.Deserialize(reader, out ventId); + await _eventManager.CallAsync(new PlayerVentEvent(_game, sender, _playerControl, (VentLocation)ventId, false)); break; case RpcCalls.ClimbLadder: Rpc31ClimbLadder.Deserialize(reader, out byte ladderId, out byte lastClimbLadderSid); - return true; + break; default: return await UnregisteredCall(call, sender); } - await _eventManager.CallAsync(new PlayerVentEvent(_game, sender, _playerControl, (VentLocation)ventId, call == RpcCalls.EnterVent)); - return true; } } From d801a36af8fc82037469d924c864328157007332 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Sun, 4 Apr 2021 10:35:00 +0200 Subject: [PATCH 12/12] Rename things for 6pak --- src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs | 6 +++--- .../Objects/Systems/ShipStatus/HeliSabotageSystemType.cs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs b/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs index c571c5a31..8ae003b24 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs @@ -58,11 +58,11 @@ public override async ValueTask DeserializeAsync(IClientPlayer sender, IClientPl while (reader.Position < reader.Length) { - IMessageReader msgReader = reader.ReadMessage(); - SystemTypes type = (SystemTypes)msgReader.Tag; + IMessageReader messageReader = reader.ReadMessage(); + SystemTypes type = (SystemTypes)messageReader.Tag; if (_systems.TryGetValue(type, out var value)) { - value.Deserialize(msgReader, initialState); + value.Deserialize(messageReader, initialState); } } } diff --git a/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs b/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs index 22a2a22d5..1d6be3206 100644 --- a/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs +++ b/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.cs @@ -36,16 +36,16 @@ public void Deserialize(IMessageReader reader, bool initialState) ActiveConsoles.Clear(); // TODO: Thread safety CompletedConsoles.Clear(); // TODO: Thread safety - var count = reader.ReadPackedUInt32(); + var activeCount = reader.ReadPackedUInt32(); - for (var i = 0; i < count; i++) + for (var i = 0; i < activeCount; i++) { ActiveConsoles.Add(new Tuple(reader.ReadByte(), reader.ReadByte())); } - var count2 = reader.ReadPackedUInt32(); + var completedCount = reader.ReadPackedUInt32(); - for (var i = 0; i < count2; i++) + for (var i = 0; i < completedCount; i++) { CompletedConsoles.Add(reader.ReadByte()); }