preemptive checks

This commit is contained in:
RaidMax 2021-01-17 22:12:18 -06:00
parent 23a33ba489
commit c419d80b57
2 changed files with 2 additions and 1 deletions

View File

@ -196,7 +196,7 @@ namespace IW4MAdmin.Application
} }
// we don't want to remove events that are correlated to command // 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 _); ProcessingEvents.Remove(newEvent.Id, out _);
} }

View File

@ -435,6 +435,7 @@ namespace IW4MAdmin.Application.RCon
if (bufferSpaceAvailable >= 0 ) if (bufferSpaceAvailable >= 0 )
{ {
_log.LogWarning("Not enough buffer space to store incoming data {bytesNeeded} additional bytes required", bufferSpaceAvailable); _log.LogWarning("Not enough buffer space to store incoming data {bytesNeeded} additional bytes required", bufferSpaceAvailable);
continue;
} }
state.ReceiveEventArgs.SetBuffer(state.ReceiveBuffer, totalBytesTransferred, sock.Available); state.ReceiveEventArgs.SetBuffer(state.ReceiveBuffer, totalBytesTransferred, sock.Available);