Bind docked zones to live PlayerView to fix stale cards on new match#11192
Merged
tool4ever merged 2 commits intoJul 10, 2026
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tool4ever
reviewed
Jul 10, 2026
Root-cause fix for docked zone tabs showing the previous game's cards after "Start New Match". getLocalPlayers() returns gameControllers.keySet(), keyed by PlayerView (equality is by id). Desktop reuses the GUI across matches without clearing the map, so when setOriginalGameController re-registers the new game's live PlayerView, HashMap.put keeps the id-equal old key and only swaps the value -- keySet() then hands back the prior game's orphaned view, which never updates. registerZoneDocs binds docked zones to that stale view. Removing the id-equal entry before re-putting makes the live instance the key, so getLocalPlayers() returns live views for every consumer. Only the key changes; the value and all id-based lookups are untouched, so existing callers behave identically. Reverts the desktop-scoped registerZoneDocs workaround. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
48cf2df to
7f15a52
Compare
tool4ever
approved these changes
Jul 10, 2026
delebedev
added a commit
to delebedev/forge
that referenced
this pull request
Jul 11, 2026
* MSC: add TriggerConnives (Card-Forge#10961) Co-authored-by: tool4ever <therealtoolkit@hotmail.com> * Edition updates: MSC, MSH * add to Keywords * Hercules, Olympian Hero and support Co-authored-by: tool4EvEr <tool4EvEr@> * Map icon fix; deckfix * Update speed_young_avenger.txt * Update ant_mans_army.txt * Change Roxxon Brutes type to Berserker Villain * Mapfix * Fix autopass not respecting event interrupts (Card-Forge#10968) * Don't track exiled tokens in the until-leaves-battlefield list (Card-Forge#10972) A token exiled "until ~ leaves" ceases to exist and can never return, but it was still added to the host's untilLeavesBattlefield list and never removed (tokens carry no exiledWith link to be cleaned up by). The stale reference showed as a ghost on the permanent and in its detail text. Exclude tokens where the list is populated, matching handleExiledWith. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix Planar deck buttons hidden behind Constructed deck button (Card-Forge#10969) Move the Constructed deck row off grid row 5, which it shared with the Planechase widgets, onto the unused row 3. The two rows are both visible when Planechase is the only selected variant, so the Constructed button was stacked on top of the planar deck buttons. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * MSC, batch 1: 40 cards, 1 token (Card-Forge#10935) * Update asgardian_inspiration.txt * MSH Jumpstart et al. batch #2 (Card-Forge#10927) * MSC, batch 2: 30 cards, 1 token (Card-Forge#10951) * CostPaymentStack: refactor and remove IndividualCostPaymentInstance (Card-Forge#10980) * Update storm_windrider.txt * MSC, batch 3: 5 cards * Update avengers_under_siege.txt * Update origin_of_the_avengers.txt * Edition updates: MSC, MSH, PMEI, SLD * Add files via upload * HealDamage: add extra HealDamageEffect (Card-Forge#10988) * fix Viv Vision, Teen Synthezoid (Card-Forge#10990) * Move Properties to their own files * MSH Jumpstart et al. batch #3 (Card-Forge#10933) * MSH Jumpstart et al. batch #4 (Card-Forge#10940) * MSC, batch 4: 5 cards (Card-Forge#10991) * Add Teamwork to SAProperties for Quantum Reduction * Fix typo * Update The Fantastic Four [MSC] [2026].dck * Update Doom Prevails [MSC] [2026].dck * Update Wakanda Forever [MSC] [2026].dck * Card cleanup: 2026-06-13, \upcoming * Edition updates: MSC * Wolverine, Fierce Fighter (MSH) (Card-Forge#10999) * Leave property checks as Statics * Card cleanup: 2026-06-14, \upcoming (Card-Forge#11002) * MSH Jumpstart et al. batch #5 (Card-Forge#10946) * Card cleanup: 2026-06-14, incidental * Virtual Assistant (MSC) * MSH Jumpstart et al. batch #6 (Card-Forge#10949) * Register controlled players on the server-side remote GUI proxy (Card-Forge#11006) Control-an-opponent effects (e.g. Secret of Bloodbending) crashed the game in multiplayer when the controlling player was a remote client. The controlled player's priority is driven through the controller's shared InputProxy, so InputProxy.update calls setCurrentPlayer on the controller's GUI. On the host that GUI is a CMatchUI whose FControlGameEventHandler registers the controlled player as local when GameEventPlayerControl fires, so the call succeeds. The server-side RemoteClientGuiGame instead uses a GameEventForwarder that only relays events to the client and never updates its own gameControllers map, so setCurrentPlayer threw IllegalArgumentException and killed the game thread. Mirror the host-side bookkeeping in RemoteClientGuiGame: on each GameEventPlayerControl, register or unregister the controlled player in the proxy's gameControllers. Identify the controller via the controlled player's mind-slave master and isLocalPlayer rather than by name, so only the actual controller's proxy registers the player. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Edition updates: SLD * Super-Adaptoid (MSH) (Card-Forge#10975) * Format updates: Add SPM to Arena formats * Alchemy Rebalancing for June 15, 2026 * Enhance skull_storm.txt with detailed spell effects Closes Card-Forge#11011 * Add Reed Richards (Card-Forge#10931) * MSH Jumpstart et al. batch #7 (Card-Forge#10955) * MSH Jumpstart et al. batch #8 (Card-Forge#10962) * MSH Jumpstart et al. batch #9 (with connive triggers and teamwork) (Card-Forge#10966) * Fix syntax for DBPump variable in Captain America card * BugReporter: extract Localizer messages (Card-Forge#10934) * Realm of legends 1.054: Assorted bugfixes (Card-Forge#11001) * Update asgardian_inspiration.txt * Mapfix * Mapfix * Mapfix for several broken bosses --------- Co-authored-by: tool4ever <therealtoolkit@hotmail.com> * ActivationTable: use Multiset for Player values (Card-Forge#10998) * Use supplier (Card-Forge#11012) * MSH Jumpstart et al. batch #10 (Card-Forge#10971) * MSH Jumpstart et al. batch #11 (Card-Forge#10973) * MSH Jumpstart et al. batch #12 (Card-Forge#10983) * Clean up (Card-Forge#11016) * Card cleanup: 2026-06-16, \upcoming (Card-Forge#11017) * Update ranking/edition files * Update blocksdata * Fix bad slots * Trigger: updated lookBackInTime (Card-Forge#11021) * Stop checking Flashback for SBA (Card-Forge#11022) * MSH: refactor additional activations (Card-Forge#10997) * Update Marvel Super Heroes.txt * Fixed item and boss droprate * Create atlas_sizable_stooge.txt * Update furious_strength.txt * Add MSH, MSC to formats * Edition updates: PWCS, SLD * Fix MSH edition * Remember replacement effect ordering (Card-Forge#11015) Co-authored-by: tool4EvEr <tool4EvEr@> * Add files via upload * Update super_adaptoid.txt * Fix GameEventPlayerStatsChanged carrying ALL cards (Card-Forge#11031) * Update Ancestral Communion card mode condition (Card-Forge#11034) * Fix based off numbers tjtillman (Card-Forge#11033) * Update captain_marvel_earths_protector.txt * Update methods_of_the_mighty.txt * Update anarchist.txt * Update animists_might.txt * Update constrictor_sage.txt * Update agent_maria_hill.txt fixed PT * Update daredevils_billy_club.txt * remove ItemPoolSorter (Card-Forge#10921) * Fix MSH edition * Add deck URL loading for Moxfield and Archidekt (Card-Forge#10570) * Update titania_rugged_rumbler.txt * Fixing Wonder Man (Card-Forge#11047) * Rename Wonder_man_hollywood_hero.txt to wonder_man_hollywood_hero.txt * Update wonder_man_hollywood_hero.txt * Migrate upcoming (Card-Forge#11046) * Clean up (Card-Forge#11048) * Add files via upload * Update bloodline_recollector_ancestral_craving.txt * Update vision_quest.txt * Add files via upload * Move GameState to game package; some cleanup (Card-Forge#11037) * Move GameState up to the forge.game module. * Change return type of method for consistency with similar methods. * Cleanup unused and only abstract method in GameState * Update rover_blades.txt fix Oracle * Update glorious_purpose.txt * Update hercules_olympian_hero.txt (Card-Forge#11051) * Update quicksilver_brash_blur.txt * Update claim_the_kingdom.txt * Edition updates: MSC, PMEI, SLD, UNK * Realm of legends 1.056: Assorted small fixes (Card-Forge#11053) * Deck and item tweaks * Mapfix * Mapfix * enemy drop fix * Update super_adaptoid.txt * Reset reused mobile GUI state between matches (Card-Forge#11042) The mobile port hands out one MatchController instance per match while desktop builds a fresh CMatchUI, so the previous match's controllers and spectator leaked into the next match and crashed setCurrentPlayer/mayView when alternating play and watch games. Reset that bookkeeping in getNewGuiGame and drop the libgdx exception-swallowing workarounds that compensated for it. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ItemColumn: nullsFirst on function (Card-Forge#11050) * ItemColumn: nullsFirst on function * Update the_second_doctor.txt * Update mister_immortal.txt * Script fixes (Card-Forge#11055) Co-authored-by: tool4EvEr <tool4EvEr@> * Fix another NoSuchMethodError (Card-Forge#11056) * Update king_solomons_frogs.txt * Fix Brawl deck generation when Wastes are legal (Card-Forge#11061) * Fix Oversimplify (Card-Forge#11062) * [maven-release-plugin] prepare release forge-2.0.13 * [maven-release-plugin] prepare for next development iteration * Restore POM files for preparation of next release * Update ManaCost for The Sensational She-Hulk * Update social_snub.txt * Edition updates: SLD * Update Ms. Marvel's static ability description Closes Card-Forge#11070 * Fix typo in DBTransform sub-ability * Support The Serpent Society (Card-Forge#11068) * Funnel lobby view updates through the EDT (Card-Forge#11067) VLobby.update touched non-thread-safe Swing state from both the Netty IO thread and the EDT; marshal both update() overloads onto the EDT so the view is only ever touched by one thread. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix logging regression (Card-Forge#11071) * Apply another Sentry suggestion (Card-Forge#11072) * Some fixes (Card-Forge#11073) * Update crossover_collaboration.txt (Card-Forge#11075) * Update brainstone.txt (Card-Forge#11077) * Update shuri_wakandan_inventor.txt Closes Card-Forge#11079 * Own floating zone windows by the main frame; raise modals above them (Card-Forge#11074) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Update love_on_the_battlefield.txt Closes Card-Forge#11083 * Change mana cost from 5 U to 2 G * Update colleen_wing_street_samurai.txt Closes Card-Forge#11085 * RoL: Cosmetic fixes (Card-Forge#11080) * Cosmetic fixes * Enemy drop fix * Desert: use PresentZone List (Card-Forge#11089) * Edition updates: PLST, PMEI, PRM * Edition updates: SLD * Realm of legends 1.058: Fix postgame boss respawn, another small bossfix (Card-Forge#11101) * Enemy drop fix * Fixed hidden final boss not respawning * Fixed broken quest reward * Prefer near-term threats for AI card choices (Card-Forge#10947) * Some fixes (Card-Forge#11104) * Update m_o_d_o_k_evil_intellect.txt Closes Card-Forge#11106 * Add files via upload (Card-Forge#11102) * Avoid self-lethal upkeep life loss plays (Card-Forge#11112) * Remove The Kingpin of Crime from AI decks (Card-Forge#11113) * Banned and Restricted Announcement for June 29, 2026 * Fix Flavor Name "Raise the Repulsor Shields" -> "Raise Repulsor Shields" * Some fixes (Card-Forge#11123) * Oracle update for Karolina Dean, Runaway (Card-Forge#11125) * Update hulk_strongest_there_is.txt Closes Card-Forge#11126 * CounterType: replace Map with Multiset (Card-Forge#11121) * CounterType: replace Map with Multiset * ~ remove extra methods --------- Co-authored-by: tool4ever <therealtoolkit@hotmail.com> * Edition updates: FIC, PF26, SLD * Update warped_tusker.txt * Matrix generated commander decks respect weights more (Card-Forge#11129) * Card: hasRemoveIntrinsic without other TypeChanges (Card-Forge#11130) * Update starks_ingenuity.txt * Fix AI not activating 'Power-Up' ability in combat * Refactor CountersPutAi (Card-Forge#11141) * Compleated: bypass Multiset can't have negative amount (Card-Forge#11142) * Realm of legends 1.059: Several deckfixes (Card-Forge#11140) * Deckfix * Deckfix * Deckfix * Deckfix * Fix Scarlet Witch, Chaotic Avenger (Card-Forge#11145) * Refactor AI express choice to remove redundant checks (Card-Forge#11149) * Clean up (Card-Forge#11151) * MagicStack: store CastThisTurn as SpellAbility (Card-Forge#11138) Co-authored-by: tool4ever <therealtoolkit@hotmail.com> * Puzzle: remove default landsPlayed values (Card-Forge#11152) * Add Typhoid Mary in MSC by dracontes * Update thran_turbine.txt (Card-Forge#11132) * Add files via upload (Card-Forge#11086) * Add files via upload (Card-Forge#11098) * Add files via upload (Card-Forge#11097) * Add files via upload (Card-Forge#11096) * Add files via upload (Card-Forge#11095) * Card cleanup: 2026-06-27 [Reminder text: Treasure token] (Card-Forge#11094) * Add files via upload * Add files via upload * Update heartless_pillage.txt * Card cleanup: 2026-06-27 [Reminder text: Investigate] (Card-Forge#11090) * Add files via upload * Add files via upload * Add files via upload (Card-Forge#11092) * Add files via upload (Card-Forge#11088) * Add files via upload (Card-Forge#11087) * Add files via upload (Card-Forge#11114) * Card cleanup: 2026-06-29 [Reminder text: Scry] (Card-Forge#11109) * Add files via upload * Add files via upload * Card cleanup: 2026-06-29 [Reminder text: Manifest] (Card-Forge#11108) * Add files via upload * Update jeskai_infiltrator.txt * Add files via upload (Card-Forge#11107) * Card cleanup: 2026-06-28 [Reminder text: Myriad] (Card-Forge#11103) * Add files via upload * Rename duke_ulder_ravenguard.txt to duke_ulder_ravengard.txt * Fix Kenrith's Court * Restrict fog effect check to zones where it can be active (Card-Forge#11157) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * AutoUpdater: test connectivity against the actual update host (Card-Forge#11163) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * Update Lorwyn Eclipsed.txt Typo fixed. * Update quicksilver_speedster.txt (Card-Forge#11166) * Fix AI eval thread races (timeout cancellation, parallel mustAttack Combat mutation) (Card-Forge#11161) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * Use MyRandom for gameplay shuffle calls * Update jocasta_automaton_avenger.txt * Edition updates: 40K, MAR, MSH, REX, SLD * Feature/11167: Proper labelling of boss-enemies * Serialize commander bracket to fix network client game-start crash (Card-Forge#11164) * Reach network-client decks through the lobby Clients already receive every player's deck in the lobby broadcast, so resolve decks from ClientGameLobby instead of the server-only match (getMatch() is transient and null after deserialization). This fixes both the commander bracket tooltip and the Game Menu deck list, which shared the same getDeck NPE on clients. The tooltip stayed hidden for a second reason: it is gated on the maximum-bracket preference, but that control lives only in the host's lobby start panel. A client never sets it, so its local copy stays at the default of 5 (off - the gate wants 1-4) and never passes. The host's value now travels in the lobby state, so clients gate the tooltip on the host's setting and both sides display identically. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Deck import: recognize Moxfield/Arena foil markers *F* and *E* Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * AI: don't reveal own top card when a conditional draw can't pay off Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * AI perf follow-ups: fog check caching, tap/untap scan zones, chump block re-evaluation (Card-Forge#11160) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * AI: pick sensible targets for pure P/T-setting animate effects (Card-Forge#11171) (Card-Forge#11181) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * CantHappen layer can stop iterating after finding one match! (Card-Forge#11186) * Clean up (Card-Forge#11188) * Add basic AI For Discover (Card-Forge#11184) * RoL: Added marvel and goblin storm commander precons (Card-Forge#11158) * Added marvel and goblin storm commander precons * Deckfix * Deckfix * Autotap - Highlight affected cards (Card-Forge#11176) Co-authored-by: tool4EvEr <tool4EvEr@> * Fix mobile NPE when auto-pay can't cover a mana cost getManaSourcesToPayCost dereferenced payManaCost's result, which is null when the cost can't be paid; guard it and make AiController's caller null-safe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Set spawning ability on Endure tokens (Card-Forge#11189) * Update SpellAbility.java * Update SpellAbilityProperty.java * Bind docked zones to live PlayerView to fix stale cards on new match (Card-Forge#11192) getLocalPlayers() returns gameControllers.keySet(), keyed by PlayerView (equality is by id). Desktop reuses the GUI across matches without clearing the map, so when setOriginalGameController re-registers the new game's live PlayerView, HashMap.put keeps the id-equal old key and only swaps the value -- keySet() then hands back the prior game's orphaned view, which never updates. registerZoneDocs binds docked zones to that stale view. Removing the id-equal entry before re-putting makes the live instance the key, so getLocalPlayers() returns live views for every consumer. Only the key changes; the value and all id-based lookups are untouched, so existing callers behave identically. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix GameEntityView duplicate counter methods --------- Co-authored-by: Hans Mackowiak <hanmac@gmx.de> Co-authored-by: tool4ever <therealtoolkit@hotmail.com> Co-authored-by: Paul Hammerton <paulhammerton1@hotmail.co.uk> Co-authored-by: Paul Hammerton <18243520+paulsnoops@users.noreply.github.com> Co-authored-by: Chris H <zenchristo@gmail.com> Co-authored-by: Fulgur14 <54345051+Fulgur14@users.noreply.github.com> Co-authored-by: VigilantSera <serafina2880@gmail.com> Co-authored-by: autumnmyst <autumnonthewind@gmail.com> Co-authored-by: MostCromulent <201167372+MostCromulent@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Renato Filipe Vidal Santos <45150760+dracontes@users.noreply.github.com> Co-authored-by: dyegoaurelio <42411160+dyegoaurelio@users.noreply.github.com> Co-authored-by: Madwand99 <Madwand99@gmail.com> Co-authored-by: Jetz72 <Jetz722@gmail.com> Co-authored-by: GitHub Actions <actions@github.com> Co-authored-by: LoganIV4 <96762238+LoganIV4@users.noreply.github.com> Co-authored-by: BigCrunch22 <59816726+BigCrunch22@users.noreply.github.com> Co-authored-by: Rauglothgor <98924238+Rauglothgor@users.noreply.github.com> Co-authored-by: steven-robert-eddy <stevenroberteddy@gmail.com> Co-authored-by: Eradev <admin@eradev.com> Co-authored-by: Byron <byron.gibson99@gmail.com> Co-authored-by: Akse1ot <krekrti@gmail.com> Co-authored-by: BramTeurlings <bram.teurlings@live.nl> Co-authored-by: Eradev <Eradev@users.noreply.github.com> Co-authored-by: Ellios77 <kvanza@gmail.com>
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.
Closes #11111.
Summary
Fixes docked zone tabs (e.g. "Playable Zone Cards") showing the previous game's cards after "Start New Match".
Bug report
With a zone view docked as a tab (rather than floating), starting a new match left the previous game's cards in the tab. They never cleared — persisting through the whole new game, even after drawing and playing. Floating zone windows were unaffected.
Root cause
At each game start,
CMatchUI.updatePlayerControlrebuilds the docked tabs viaFloatingZone.registerZoneDocs, binding eachVZoneto aPlayerViewfromgetLocalPlayers()(thegameControllerskey set). On restart the desktop reuses the sameCMatchUIwithout resetting controller state (only mobile callsresetForNewMatch), and the new game installs freshPlayerViewinstances. BecauseTrackableObjectequality is by id, re-registering the local player leaves theHashMap's original stale key in place — sogetLocalPlayers()returns an orphanedPlayerViewfrom the prior game that never receives updates. Floating windows dodge this by being rebuilt lazily on click against the live view.Fix
Source the local players from the live game view (
getGameView().getPlayers()filtered byisLocalPlayer) instead ofgetLocalPlayers(), so docked zones bind to the livePlayerViewand refresh correctly.Alternative considered
Resetting the reused controller state each game (mirroring mobile's
resetForNewMatch) would fix the root cause more broadly. It was not taken here because it lives in shared lifecycle code (AbstractGuiGame/HostedMatch) exercised by desktop, mobile, network host, and client — a much larger blast radius. This PR takes the lower-risk desktop-scoped fix.🤖 Generated with Claude Code