Improve auth error feedback with specific failure reasons, version mismatch details, and connection timeout

This commit is contained in:
Kelsi 2026-02-05 12:17:09 -08:00
parent 78442f8aea
commit a52e28191e
4 changed files with 56 additions and 26 deletions

View file

@ -105,7 +105,7 @@ void AuthHandler::handleLogonChallengeResponse(network::Packet& packet) {
LogonChallengeResponse response;
if (!LogonChallengeResponseParser::parse(packet, response)) {
fail("Failed to parse LOGON_CHALLENGE response");
fail("Server sent an invalid response - it may use an incompatible protocol version");
return;
}
@ -140,18 +140,18 @@ void AuthHandler::handleLogonProofResponse(network::Packet& packet) {
LogonProofResponse response;
if (!LogonProofResponseParser::parse(packet, response)) {
fail("Failed to parse LOGON_PROOF response");
fail("Server sent an invalid login response - it may use an incompatible protocol");
return;
}
if (!response.isSuccess()) {
fail("LOGON_PROOF failed: invalid proof");
fail("Login failed - incorrect username or password");
return;
}
// Verify server proof
if (!srp->verifyServerProof(response.M2)) {
fail("Server proof verification failed");
fail("Server identity verification failed - the server may be running an incompatible version");
return;
}

View file

@ -6,25 +6,29 @@ namespace auth {
const char* getAuthResultString(AuthResult result) {
switch (result) {
case AuthResult::SUCCESS: return "Success";
case AuthResult::UNKNOWN0: return "Unknown Error 0";
case AuthResult::UNKNOWN1: return "Unknown Error 1";
case AuthResult::ACCOUNT_BANNED: return "Account Banned";
case AuthResult::ACCOUNT_INVALID: return "Account Invalid";
case AuthResult::PASSWORD_INVALID: return "Password Invalid";
case AuthResult::ALREADY_ONLINE: return "Already Online";
case AuthResult::OUT_OF_CREDIT: return "Out of Credit";
case AuthResult::BUSY: return "Server Busy";
case AuthResult::BUILD_INVALID: return "Build Invalid";
case AuthResult::BUILD_UPDATE: return "Build Update Required";
case AuthResult::INVALID_SERVER: return "Invalid Server";
case AuthResult::ACCOUNT_SUSPENDED: return "Account Suspended";
case AuthResult::ACCESS_DENIED: return "Access Denied";
case AuthResult::SURVEY: return "Survey Required";
case AuthResult::PARENTAL_CONTROL: return "Parental Control";
case AuthResult::LOCK_ENFORCED: return "Lock Enforced";
case AuthResult::TRIAL_EXPIRED: return "Trial Expired";
case AuthResult::BATTLE_NET: return "Battle.net Error";
default: return "Unknown";
case AuthResult::UNKNOWN0: return "Unknown error (0x01)";
case AuthResult::UNKNOWN1: return "Unknown error (0x02)";
case AuthResult::ACCOUNT_BANNED: return "This account has been banned";
case AuthResult::ACCOUNT_INVALID: return "Account not found - check your username";
case AuthResult::PASSWORD_INVALID: return "Incorrect password";
case AuthResult::ALREADY_ONLINE: return "This account is already logged in";
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";
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)";
case AuthResult::INVALID_SERVER: return "Invalid server";
case AuthResult::ACCOUNT_SUSPENDED: return "This account has been suspended";
case AuthResult::ACCESS_DENIED: return "Access denied";
case AuthResult::SURVEY: return "Survey required";
case AuthResult::PARENTAL_CONTROL: return "Blocked by parental controls";
case AuthResult::LOCK_ENFORCED: return "Account locked - check your email";
case AuthResult::TRIAL_EXPIRED: return "Trial period has expired";
case AuthResult::BATTLE_NET: return "Battle.net error";
default: return "Unknown error";
}
}