Logout returns to character select on the same world connection (#1022)

In 1.12.1, logging out or a refused character login returns to character select on the same world connection and re-lists there (`0x5aaeb0` → `0x401ee0`, then `0x46b880` → `CMSG_CHAR_ENUM`). There's no realmd logon and no new `CMSG_AUTH_SESSION`. Enter World closes the realmd link (`0x46b70c` → `0x5b3320`), and only the glue's own re-dials reopen it.

- benilla used to drop the socket and log on again from cached credentials. Now the world session splits and rejoins on one connection, and the header cipher carries its state across.
- The realmd link closes at the pick.
- A leftover packet at character select is skipped rather than fatal.
- The write thread applies a pending writer swap before any command.
- A kept-link teardown ends the character without a "server down".

Fake-server tests pin one logon, one auth and one more enumerate. The logout smoke fails without a same-link relist.

Fixes #984
Fixes #983

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sam Sung
2026-10-12 17:38:05 +07:00
committed by GitHub
co-authored by Claude Opus 5.5
parent aba120cdcb
commit d759008172
19 changed files with 1330 additions and 424 deletions
+9
View File
@@ -101,6 +101,15 @@ printf '%s' "$plain" | grep -q "logout-smoke: empty roster" &&
fail "$user has no characters — the re-entry leg cannot run (make one, or rig it: WOW_RIG=…)"
printf '%s' "$plain" | grep -q "logout-smoke: done" ||
fail "the round trip never completed (no 'logout-smoke: done')"
# The logout returns to character select on the link the world was entered by and re-lists there
# (`0x5aaeb0` → `0x46b880`): a roster on that world session, and one realmd logon for the walk.
printf '%s' "$plain" | grep -q "logout-smoke: FAILED" &&
fail "$(printf '%s\n' "$plain" | sed -n 's/.*logout-smoke: FAILED — //p' | tail -1)"
printf '%s' "$plain" | grep -q "logout-smoke: roster after the logout on the same link" ||
fail "no roster came on the same link after the logout"
logons="$(printf '%s\n' "$plain" | grep -cF "net: parked at the realm list")"
[ "$logons" -eq 1 ] ||
fail "$logons realmd logons in the round trip, expected 1 — the logout logged on again"
# The re-entered character must be drivable: the leg lists what would block movement (a /logout
# root must end with its session), and anything but `none` fails.