From ce484fc765d04a583363f10663e025333648cd49 Mon Sep 17 00:00:00 2001 From: Mag-nus Date: Tue, 13 Feb 2024 14:46:41 -0600 Subject: [PATCH] Move packet retransmit to packetlog and reduce to debug --- Source/ACE.Server/Network/NetworkSession.cs | 23 ++++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Source/ACE.Server/Network/NetworkSession.cs b/Source/ACE.Server/Network/NetworkSession.cs index f7119bf1fe..dc74d24ba0 100644 --- a/Source/ACE.Server/Network/NetworkSession.cs +++ b/Source/ACE.Server/Network/NetworkSession.cs @@ -660,20 +660,23 @@ private bool Retransmit(uint sequence) return true; } - if (cachedPackets.Count > 0) + if (packetLog.IsDebugEnabled) { - // This is to catch a race condition between .Count and .Min() and .Max() - try - { - log.Error($"Session {session.Network?.ClientId}\\{session.EndPointC2S} ({session.Account}:{session.Player?.Name}) retransmit requested packet {sequence} not in cache. Cache range {cachedPackets.Keys.Min()} - {cachedPackets.Keys.Max()}."); - } - catch + if (cachedPackets.Count > 0) { - log.Error($"Session {session.Network?.ClientId}\\{session.EndPointC2S} ({session.Account}:{session.Player?.Name}) retransmit requested packet {sequence} not in cache. Cache is empty. Race condition threw exception."); + // This is to catch a race condition between .Count and .Min() and .Max() + try + { + packetLog.DebugFormat("Session {0}\\{1} ({2}:{3}) retransmit requested packet {4} not in cache. Cache range {5} - {6}.", session.Network?.ClientId, session.EndPointC2S, session.Account, session.Player?.Name, sequence, cachedPackets.Keys.Min(), cachedPackets.Keys.Max()); + } + catch + { + packetLog.DebugFormat("Session {0}\\{1} ({2}:{3}) retransmit requested packet {4} not in cache. Cache is empty. Race condition threw exception.", session.Network?.ClientId, session.EndPointC2S, session.Account, session.Player?.Name, sequence); + } } + else + packetLog.DebugFormat("Session {0}\\{1} ({2}:{3}) retransmit requested packet {4} not in cache. Cache is empty.", session.Network?.ClientId, session.EndPointC2S, session.Account, session.Player?.Name, sequence); } - else - log.Error($"Session {session.Network?.ClientId}\\{session.EndPointC2S} ({session.Account}:{session.Player?.Name}) retransmit requested packet {sequence} not in cache. Cache is empty."); return false; }