From dca8fcad31a1c019abce8df04a556785082c46ee Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Feb 2026 01:03:54 -0800 Subject: [PATCH] Handle short vanilla LOGON_PROOF success responses --- src/network/tcp_socket.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/tcp_socket.cpp b/src/network/tcp_socket.cpp index b87f134c..fc02336b 100644 --- a/src/network/tcp_socket.cpp +++ b/src/network/tcp_socket.cpp @@ -230,11 +230,15 @@ size_t TCPSocket::getExpectedPacketSize(uint8_t opcode) { case 0x01: // LOGON_PROOF response // Success: opcode(1) + status(1) + M2(20) + accountFlags(4) + surveyId(4) + loginFlags(2) = 32 + // Some vanilla-era servers send a shorter success response: + // opcode(1) + status(1) + M2(20) = 22 // Failure: varies by server — minimum 2 bytes (opcode + status), some send 4 if (receiveBuffer.size() >= 2) { uint8_t status = receiveBuffer[1]; if (status == 0x00) { - return 32; // Success (WotLK 3.3.5a format) + if (receiveBuffer.size() >= 32) return 32; // WotLK-style + if (receiveBuffer.size() >= 22) return 22; // minimal/vanilla-style + return 0; } else { // Consume up to 4 bytes if available, minimum 2 return (receiveBuffer.size() >= 4) ? 4 : 2;