Fail fast when auth TCP disconnects during authentication

This commit is contained in:
Kelsi 2026-02-13 01:14:33 -08:00
parent 9091cb0496
commit b3001a4b5b

View file

@ -433,6 +433,17 @@ void AuthHandler::update(float /*deltaTime*/) {
// Update socket (processes incoming data and calls packet callback)
socket->update();
// If the server drops the TCP connection mid-auth, surface it as an auth failure immediately
// (otherwise the UI just hits its generic timeout).
if (!socket->isConnected()) {
if (state != AuthState::DISCONNECTED &&
state != AuthState::FAILED &&
state != AuthState::AUTHENTICATED &&
state != AuthState::REALM_LIST_RECEIVED) {
fail("Disconnected by auth server");
}
}
}
void AuthHandler::setState(AuthState newState) {