Propagate realm-reported build to world handshake for vanilla compatibility
Some checks failed
Build / Build (arm64) (push) Has been cancelled
Build / Build (x86-64) (push) Has been cancelled
Build / Build (macOS arm64) (push) Has been cancelled
Build / Build (windows-arm64) (push) Has been cancelled
Build / Build (windows-x86-64) (push) Has been cancelled
Security / CodeQL (C/C++) (push) Has been cancelled
Security / Semgrep (push) Has been cancelled
Security / Sanitizer Build (ASan/UBSan) (push) Has been cancelled

- Prefer realm.build over profile worldBuild when non-zero in CMSG_AUTH_SESSION
- Fixes vanilla (1.12.1 build 5875) servers rejecting connection due to wrong build
- Suppress v0.0.0 display in realm list when version info is all zeros
This commit is contained in:
Kelsi 2026-02-27 05:05:44 -08:00
parent 16d88f19fc
commit 0e1241ca60
2 changed files with 12 additions and 4 deletions

View file

@ -1349,16 +1349,18 @@ void Application::setupUICallbacks() {
} }
uint32_t realmId = 0; uint32_t realmId = 0;
uint16_t realmBuild = 0;
{ {
// WotLK AUTH_SESSION includes a RealmID field; some servers reject if it's wrong/zero. // WotLK AUTH_SESSION includes a RealmID field; some servers reject if it's wrong/zero.
const auto& realms = authHandler->getRealms(); const auto& realms = authHandler->getRealms();
for (const auto& r : realms) { for (const auto& r : realms) {
if (r.name == realmName && r.address == realmAddress) { if (r.name == realmName && r.address == realmAddress) {
realmId = r.id; realmId = r.id;
realmBuild = r.build;
break; break;
} }
} }
LOG_INFO("Selected realmId=", realmId); LOG_INFO("Selected realmId=", realmId, " realmBuild=", realmBuild);
} }
uint32_t clientBuild = 12340; // default WotLK uint32_t clientBuild = 12340; // default WotLK
@ -1366,6 +1368,12 @@ void Application::setupUICallbacks() {
auto* profile = expansionRegistry_->getActive(); auto* profile = expansionRegistry_->getActive();
if (profile) clientBuild = profile->worldBuild; if (profile) clientBuild = profile->worldBuild;
} }
// Prefer realm-reported build when available (e.g. vanilla servers
// that report build 5875 in the realm list)
if (realmBuild != 0) {
clientBuild = realmBuild;
LOG_INFO("Using realm-reported build: ", clientBuild);
}
if (gameHandler->connect(host, port, sessionKey, accountName, clientBuild, realmId)) { if (gameHandler->connect(host, port, sessionKey, accountName, clientBuild, realmId)) {
LOG_INFO("Connected to world server, transitioning to character selection"); LOG_INFO("Connected to world server, transitioning to character selection");
setState(AppState::CHARACTER_SELECTION); setState(AppState::CHARACTER_SELECTION);

View file

@ -179,10 +179,10 @@ void RealmScreen::render(auth::AuthHandler& authHandler) {
ImGui::TextColored(ImVec4(0.4f, 0.9f, 1.0f, 1.0f), ImGui::TextColored(ImVec4(0.4f, 0.9f, 1.0f, 1.0f),
" - %d character%s", realm.characters, realm.characters > 1 ? "s" : ""); " - %d character%s", realm.characters, realm.characters > 1 ? "s" : "");
} }
if (realm.hasVersionInfo()) { if (realm.hasVersionInfo() && (realm.majorVersion || realm.build)) {
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled(" v%d.%d.%d", ImGui::TextDisabled(" v%d.%d.%d (build %d)",
realm.majorVersion, realm.minorVersion, realm.patchVersion); realm.majorVersion, realm.minorVersion, realm.patchVersion, realm.build);
} }
ImGui::Spacing(); ImGui::Spacing();