From edd81d903bd9ac9b47a835eeacb72eef67852cd4 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Thu, 28 Nov 2024 20:53:21 -0600 Subject: [PATCH] add T6 to list of games requiring delay before reading rcon response --- Integrations/Cod/CodRConConnection.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Integrations/Cod/CodRConConnection.cs b/Integrations/Cod/CodRConConnection.cs index 2b299361..30c3c2e2 100644 --- a/Integrations/Cod/CodRConConnection.cs +++ b/Integrations/Cod/CodRConConnection.cs @@ -34,6 +34,7 @@ namespace Integrations.Cod private readonly ILogger _log; private readonly Encoding _gameEncoding; private readonly int _retryAttempts; + private static readonly Server.Game[] RconDelayGames = [Server.Game.IW3, Server.Game.T4, Server.Game.T5, Server.Game.T6]; public CodRConConnection(IPEndPoint ipEndpoint, string password, ILogger log, Encoding gameEncoding, int retryAttempts) @@ -377,9 +378,9 @@ namespace Integrations.Cod await ReceiveAndStoreSocketData(rconSocket, token, connectionState); - if (_parser.GameName is Server.Game.IW3 or Server.Game.T4) + if (RconDelayGames.Contains(_parser.GameName)) { - await Task.Delay(100, token); // CoD4x shenanigans + await Task.Delay(100, token); } while (rconSocket.Available > 0)