fix(coop): null-base arrival crash + owner labels - #109
Merged
Conversation
SHARED "ordered soldiers arrive -> 2nd player crashes": the arrival popup (ItemsArrivingState) reached the client via hostAlert with a null _base (a replica's own transfers are frozen), and "Go to Base" built BasescapeState(nullptr), whose coop ctor block dereferenced it (0xC0000005 read at [null+0x1d0]). A: guard the BasescapeState ctor's early _base dereferences. B: ItemsArrivingState "Go to Base" falls back to a real base when _base is unresolved. C: both players now see the full arrival list; soldiers not owned by the viewing player are prefixed with the owner's username, e.g. "[HostPlayer] Sergey Moronova". The host builds authoritative rows and ships them on the existing alert lane; the client rebuilds the popup from them via a display-only ctor. A rows-less arrival alert no longer pops (no empty phantom popup on either machine). Tests (all green): test_shared_arrival_owner_labels.py (new), test_shared_soldier_arrival_crash.py (new), test_shared_alerts.py updated for the rows-based ItemsArrivingState. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
NonPolynomialTim
enabled auto-merge (squash)
July 31, 2026 03:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a SHARED-coop crash a player reported ("order soldiers in a shared base as host → the 2nd player crashes on arrival"), and adds owner-labelled arrival lists.
Root cause (from the player's crash dump): on arrival the
ItemsArrivingStatepopup reaches the client viaSharedEcon::hostAlertwith a null_base— a replica's own transfers are frozen (PRD-J04), so the popup's ctor finds no hour-0 transfer. Pressing "Go to Base" then builtBasescapeState(nullptr), whose coop ctor blockif (_base->_coopBase == true)dereferenced the null base →0xC0000005read at[null+0x1d0].Changes
BasescapeStatector's early_basedereferences (the coop block ran beforeinit()/setBase()could normalize a null base).ItemsArrivingState"Go to Base" falls back to a real base when_baseis unresolved.[HostPlayer] Sergey Moronova. The host builds authoritative rows in its (unchanged) scan-path popup and ships them on the existingalertlane (hostAlertgains arowsparam); the client rebuilds the popup from them via a display-only ctor. The prefix is applied per-viewer using the stable, machine-independent seat→username roster (SavedGame::_coopPlayers).Behavior change
A rows-less
ItemsArrivingStatealert no longer pops — the empty phantom popup on the replica is gone (and the host won't pop an empty one either). Real arrivals always carry rows.Tests (all green)
tools/coop_test/test_shared_arrival_owner_labels.py(new) — host-hires + client-hires; asserts the owner sees a bare name and the peer sees[Owner] name, both directions.tools/coop_test/test_shared_soldier_arrival_crash.py(new) — end-to-end hire → arrival → Go-to-Base, plus an unresolved-base alert; both no-crash. Went RED against a no-fix build (client process died, WinError 10054), GREEN after A+B.tools/coop_test/test_shared_alerts.py— updated for the rows-basedItemsArrivingState; all 8 alert classes still replicate.🤖 Generated with Claude Code