mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-28 22:45:55 +00:00
feat(Core/Network): Per-user togglable packet logging (#23254)
Co-authored-by: Ryan Turner <16946913+TheSCREWEDSoftware@users.noreply.github.com>
This commit is contained in:
@@ -117,7 +117,7 @@ void EncryptableAndCompressiblePacket::CompressIfNeeded()
|
||||
}
|
||||
|
||||
WorldSocket::WorldSocket(tcp::socket&& socket)
|
||||
: Socket(std::move(socket)), _OverSpeedPings(0), _worldSession(nullptr), _authed(false), _sendBufferSize(4096)
|
||||
: Socket(std::move(socket)), _OverSpeedPings(0), _worldSession(nullptr), _authed(false), _sendBufferSize(4096), _loggingPackets(false)
|
||||
{
|
||||
Acore::Crypto::GetRandomBytes(_authSeed);
|
||||
_headerBuffer.Resize(sizeof(ClientPktHeader));
|
||||
@@ -406,7 +406,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
|
||||
WorldPacket packet(opcode, std::move(_packetBuffer));
|
||||
WorldPacket* packetToQueue;
|
||||
|
||||
if (sPacketLog->CanLogPacket())
|
||||
if (sPacketLog->CanLogPacket() && IsLoggingPackets())
|
||||
sPacketLog->LogPacket(packet, CLIENT_TO_SERVER, GetRemoteIpAddress(), GetRemotePort());
|
||||
|
||||
std::unique_lock<std::mutex> sessionGuard(_worldSessionLock, std::defer_lock);
|
||||
@@ -520,7 +520,7 @@ void WorldSocket::SendPacket(WorldPacket const& packet)
|
||||
if (!IsOpen())
|
||||
return;
|
||||
|
||||
if (sPacketLog->CanLogPacket())
|
||||
if (sPacketLog->CanLogPacket() && IsLoggingPackets())
|
||||
sPacketLog->LogPacket(packet, SERVER_TO_CLIENT, GetRemoteIpAddress(), GetRemotePort());
|
||||
|
||||
_bufferQueue.Enqueue(new EncryptableAndCompressiblePacket(packet, _authCrypt.IsInitialized()));
|
||||
|
||||
Reference in New Issue
Block a user