From c419d80b577c94c3d0dfb8617a47c0dc34c9837e Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sun, 17 Jan 2021 22:12:18 -0600 Subject: [PATCH] preemptive checks --- Application/ApplicationManager.cs | 2 +- Application/RCon/RConConnection.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/ApplicationManager.cs b/Application/ApplicationManager.cs index e16ec0469..7ecafa7be 100644 --- a/Application/ApplicationManager.cs +++ b/Application/ApplicationManager.cs @@ -196,7 +196,7 @@ namespace IW4MAdmin.Application } // we don't want to remove events that are correlated to command - if (ProcessingEvents.Values.Count(gameEvent => gameEvent.CorrelationId == newEvent.CorrelationId) == 1) + if (ProcessingEvents.Values.ToList()?.Count(gameEvent => gameEvent.CorrelationId == newEvent.CorrelationId) == 1) { ProcessingEvents.Remove(newEvent.Id, out _); } diff --git a/Application/RCon/RConConnection.cs b/Application/RCon/RConConnection.cs index 6995373db..8e0e8725c 100644 --- a/Application/RCon/RConConnection.cs +++ b/Application/RCon/RConConnection.cs @@ -435,6 +435,7 @@ namespace IW4MAdmin.Application.RCon if (bufferSpaceAvailable >= 0 ) { _log.LogWarning("Not enough buffer space to store incoming data {bytesNeeded} additional bytes required", bufferSpaceAvailable); + continue; } state.ReceiveEventArgs.SetBuffer(state.ReceiveBuffer, totalBytesTransferred, sock.Available);