Temp: fix auth packet dump (correct fmt + raw header bytes)
Build (Windows x64) / build (push) Canceled after 0s
Build (Windows x64) / linux-build (push) Canceled after 0s

This commit is contained in:
devbox
2026-08-15 12:47:18 +10:00
parent f88f29651b
commit ff287e022d
+17 -1
View File
@@ -340,6 +340,22 @@ bool WorldSocket::ReadHeaderHandler()
IncomingPacketHeader* header = reinterpret_cast<IncomingPacketHeader*>(_headerBuffer.GetReadPointer());
uint32 encryptedOpcode = header->EncryptedOpcode;
if (encryptedOpcode == CMSG_AUTH_SESSION)
{
std::string hdrHex;
hdrHex.reserve(sizeof(IncomingPacketHeader) * 3);
static constexpr char hdrDigits[] = "0123456789ABCDEF";
uint8 const* hdrBytes = _headerBuffer.GetReadPointer();
for (std::size_t i = 0; i < sizeof(IncomingPacketHeader); ++i)
{
uint8 b = hdrBytes[i];
hdrHex.push_back(hdrDigits[b >> 4]);
hdrHex.push_back(hdrDigits[b & 0xF]);
hdrHex.push_back(' ');
}
TC_LOG_ERROR("network", "CMSG_AUTH_SESSION raw header ({} bytes): {}", sizeof(IncomingPacketHeader), hdrHex);
}
if (!header->IsValidSize())
{
_authCrypt.PeekDecryptRecv(reinterpret_cast<uint8*>(&header->EncryptedOpcode), sizeof(encryptedOpcode));
@@ -624,7 +640,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::HandleAuthSession(WorldPacket&&
rawHex.push_back(hexDigits[b & 0xF]);
rawHex.push_back(' ');
}
TC_LOG_ERROR("network", "CMSG_AUTH_SESSION raw (%zu bytes): {}", packet.size(), rawHex);
TC_LOG_ERROR("network", "CMSG_AUTH_SESSION raw ({} bytes): {}", packet.size(), rawHex);
if (_authed)
{