Kelsidavis-WoWee/src/auth/auth_opcodes.cpp
Kelsi 5ef11fdc7d Fix auth protocol to match real WoW 3.3.5a client format
Three critical bugs fixed:
- LOGON_CHALLENGE request: set protocol byte to 0x03 (was 0x00) and
  reverse FourCC strings (game/platform/os/locale) to match real client
- Response parsers: remove double-read of opcode byte that shifted all
  field reads by one, preventing successful auth with real servers
- LOGON_PROOF response sizes: success=32 bytes, failure=4 bytes to match
  TrinityCore/AzerothCore format

Also adds missing auth result codes (0x13-0x20, 0xFF) including
IGR_WITHOUT_BNET (0x17) which Warmane was returning.
2026-02-05 12:39:34 -08:00

54 lines
2.9 KiB
C++

#include "auth/auth_opcodes.hpp"
#include <cstdio>
namespace wowee {
namespace auth {
static char authResultBuf[256];
const char* getAuthResultString(AuthResult result) {
switch (result) {
case AuthResult::SUCCESS: return "Success";
case AuthResult::UNKNOWN0: return "Unknown server error (code 0x01)";
case AuthResult::UNKNOWN1: return "Unknown server error (code 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";
case AuthResult::ANTI_INDULGENCE: return "Anti-indulgence time limit reached";
case AuthResult::EXPIRED: return "Account subscription has expired";
case AuthResult::NO_GAME_ACCOUNT: return "No game account found - create one on the server website";
case AuthResult::CHARGEBACK: return "Account locked due to chargeback";
case AuthResult::IGR_WITHOUT_BNET:
return "Internet Game Room access denied - account may require "
"registration on the server website";
case AuthResult::GAME_ACCOUNT_LOCKED: return "Game account is locked";
case AuthResult::UNLOCKABLE_LOCK: return "Account is locked and cannot be unlocked";
case AuthResult::CONVERSION_REQUIRED: return "Account conversion required";
case AuthResult::DISCONNECTED: return "Disconnected from server";
default:
snprintf(authResultBuf, sizeof(authResultBuf),
"Server rejected login (error code 0x%02X)",
static_cast<unsigned>(result));
return authResultBuf;
}
}
} // namespace auth
} // namespace wowee