Net: handle in-game GC_PHASE like the Windows client

PHASE_SELECT returns the connection to LoginSession (cached roster,
SelectReady, later LOGIN_SUCCESS refreshes), PHASE_CLOSE goes to the
login phase, LOADING clears the player, GAME refreshes the status and
DEAD no longer leaves the game phase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-13 13:24:12 +09:00
co-authored by Claude Opus 5.5
parent 189da4c269
commit 40cac5cf52
9 changed files with 113 additions and 24 deletions
+1
View File
@@ -1717,6 +1717,7 @@ P0, the real-server flow stops:
1. `RecvWarpPacket` reads and drops GC_WARP. Windows sets DirectEnter for the selected slot and reconnects to `lAddr:wPort`. Map teleports and channel moves hang.
- **Fixed:** `RecvWarpPacket` stops processing the old socket and `pump_python_net` calls `LoginClient::warp`. It reconnects like DirectEnter: same login key, the remembered selected slot, a new generation so the server clock is re-synced, and `SetNewLoadingPhase` (ENABLE_NEW_LOADING). A connect failure under DirectEnter is ClosePhase (`SetLoginPhase`). Covered in `login_oracle_test`.
2. In-game `RecvPhasePacket` only stores the phase. Windows calls `SetSelectPhase` (plus `__DownloadMark`), `SetLoginPhase`, `SetLoadingPhase`, `SetGamePhase` or `ClosePhase`. Going back to character select and reloading after a warp do not work.
- **Fixed:** `RecvPhasePacket` follows the Windows switch: CLOSE → SetLoginPhase; SELECT → leave the game phase and hand the unread bytes back to `LoginSession::return_to_select`, which shows the cached roster at once (SelectReady); a later LOGIN_SUCCESS raises SelectRefresh → select window `Refresh`; LOADING → player clear; GAME → status refresh; DEAD → no-op (it used to make `IsGamePhase()` false). `__DownloadMark` waits on item 8.
3. `LoginSession` (select phase) only accepts headers 0/7/32/44/90/150-153/253-255 and drops the connection on anything else. The following are missing:
- GC 6 LOGIN_SUCCESS3;
- GC 8/9 PLAYER_CREATE_SUCCESS/FAILURE;