Fix expansion auth protocol versions + improve version mismatch errors

This commit is contained in:
Kelsi 2026-02-13 00:36:46 -08:00
parent 2082ef1422
commit 371315f5ad
5 changed files with 30 additions and 12 deletions

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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<unsigned>(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<unsigned>(response.result) << std::dec << ")";
}
fail(ss.str());
} else {
LOG_WARNING("Unexpected LOGON_CHALLENGE response in state: ", (int)state);

View file

@ -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";