diff --git a/Data/expansions/classic/expansion.json b/Data/expansions/classic/expansion.json index b8d3181e..606a9aaf 100644 --- a/Data/expansions/classic/expansion.json +++ b/Data/expansions/classic/expansion.json @@ -4,7 +4,7 @@ "shortName": "Classic", "version": { "major": 1, "minor": 12, "patch": 1 }, "build": 5875, - "protocolVersion": 8, + "protocolVersion": 3, "maxLevel": 60, "races": [1, 2, 3, 4, 5, 6, 7, 8], "classes": [1, 2, 3, 4, 5, 7, 8, 9, 11] diff --git a/Data/expansions/tbc/expansion.json b/Data/expansions/tbc/expansion.json index c3af88cf..025f9a9b 100644 --- a/Data/expansions/tbc/expansion.json +++ b/Data/expansions/tbc/expansion.json @@ -4,7 +4,7 @@ "shortName": "TBC", "version": { "major": 2, "minor": 4, "patch": 3 }, "build": 8606, - "protocolVersion": 8, + "protocolVersion": 5, "maxLevel": 70, "races": [1, 2, 3, 4, 5, 6, 7, 8, 10, 11], "classes": [1, 2, 3, 4, 5, 6, 7, 8, 9, 11] diff --git a/Data/expansions/turtle/expansion.json b/Data/expansions/turtle/expansion.json index b0b032a0..c14f95a4 100644 --- a/Data/expansions/turtle/expansion.json +++ b/Data/expansions/turtle/expansion.json @@ -4,7 +4,7 @@ "shortName": "Turtle", "version": { "major": 1, "minor": 12, "patch": 1 }, "build": 5875, - "protocolVersion": 8, + "protocolVersion": 3, "maxLevel": 60, "races": [1, 2, 3, 4, 5, 6, 7, 8], "classes": [1, 2, 3, 4, 5, 7, 8, 9, 11] diff --git a/src/auth/auth_handler.cpp b/src/auth/auth_handler.cpp index 5bed9777..b5b91c96 100644 --- a/src/auth/auth_handler.cpp +++ b/src/auth/auth_handler.cpp @@ -167,7 +167,18 @@ void AuthHandler::handleLogonChallengeResponse(network::Packet& packet) { } if (!response.isSuccess()) { - fail(std::string("LOGON_CHALLENGE failed: ") + getAuthResultString(response.result)); + if (response.result == AuthResult::BUILD_INVALID || response.result == AuthResult::BUILD_UPDATE) { + std::ostringstream ss; + ss << "LOGON_CHALLENGE failed: version mismatch (client v" + << (int)clientInfo.majorVersion << "." + << (int)clientInfo.minorVersion << "." + << (int)clientInfo.patchVersion + << " build " << clientInfo.build + << ", auth protocol " << (int)clientInfo.protocolVersion << ")"; + fail(ss.str()); + } else { + fail(std::string("LOGON_CHALLENGE failed: ") + getAuthResultString(response.result)); + } return; } @@ -353,13 +364,22 @@ void AuthHandler::handlePacket(network::Packet& packet) { LogonChallengeResponse response; if (LogonChallengeResponseParser::parse(packet, response) && !response.isSuccess()) { std::ostringstream ss; - ss << "Server cancelled authentication"; + ss << "LOGON_CHALLENGE failed"; if (state == AuthState::PIN_REQUIRED) { ss << " while waiting for 2FA/PIN code"; } - ss << ": " << getAuthResultString(response.result) - << " (code 0x" << std::hex << std::setw(2) << std::setfill('0') - << static_cast(response.result) << std::dec << ")"; + if (response.result == AuthResult::BUILD_INVALID || response.result == AuthResult::BUILD_UPDATE) { + ss << ": version mismatch (client v" + << (int)clientInfo.majorVersion << "." + << (int)clientInfo.minorVersion << "." + << (int)clientInfo.patchVersion + << " build " << clientInfo.build + << ", auth protocol " << (int)clientInfo.protocolVersion << ")"; + } else { + ss << ": " << getAuthResultString(response.result) + << " (code 0x" << std::hex << std::setw(2) << std::setfill('0') + << static_cast(response.result) << std::dec << ")"; + } fail(ss.str()); } else { LOG_WARNING("Unexpected LOGON_CHALLENGE response in state: ", (int)state); diff --git a/src/auth/auth_opcodes.cpp b/src/auth/auth_opcodes.cpp index 338805cf..13611522 100644 --- a/src/auth/auth_opcodes.cpp +++ b/src/auth/auth_opcodes.cpp @@ -18,11 +18,9 @@ const char* getAuthResultString(AuthResult result) { case AuthResult::OUT_OF_CREDIT: return "Account out of credit/time"; case AuthResult::BUSY: return "Server is busy - try again later"; case AuthResult::BUILD_INVALID: - return "Version mismatch - this client is WotLK 3.3.5a (build 12340). " - "The server requires a different client version"; + return "Version mismatch - the server requires a different client build/version"; case AuthResult::BUILD_UPDATE: - return "Client update required - the server expects a different build version. " - "This client only supports WotLK 3.3.5a (build 12340)"; + return "Client update required - the server expects a different client build/version"; case AuthResult::INVALID_SERVER: return "Invalid server"; case AuthResult::ACCOUNT_SUSPENDED: return "This account has been suspended"; case AuthResult::ACCESS_DENIED: return "Access denied";