Skip to content

Add draft and sealed modes to online multiplayer (desktop)#10474

Draft
MostCromulent wants to merge 8 commits intoCard-Forge:masterfrom
MostCromulent:network-draft-sealed
Draft

Add draft and sealed modes to online multiplayer (desktop)#10474
MostCromulent wants to merge 8 commits intoCard-Forge:masterfrom
MostCromulent:network-draft-sealed

Conversation

@MostCromulent
Copy link
Copy Markdown
Contributor

@MostCromulent MostCromulent commented Apr 20, 2026

Apologies to the devs for another huge PR - I think this one is worth it though! 🙏

Phase 1A of #10429 - DESKTOP ONLY

Mobile support will come in follow-up PR once we are happy with architecture and UI flow on this.

Architectural reference document here. (Updated 23/04/2026)

Basic workflow

Screenshot 2026-04-21 064312
  1. Lobby mode. The online lobby gains a Constructed / Limited mode selector. In Limited mode the host creates an event via a short wizard (Draft or Sealed → pool type → block/set sub-dialogs → pick timer + disconnect grace window for draft). Event config is displayed in a UI panel and visible to all players before they ready up.
  2. Pod assembly. Participants are populated from lobby slots; remaining seats are auto-filled with AI for draft; seats are shuffled before start.
  3. Run the event.
    • Draft — all human hosts and clients draft simultaneously using the normal draft UI. AI seats pick in between human rounds. Each pack is routed to the correct seat via DraftPackArrivedEvent. A floating picker overlay shows current draft status. Progress of the draft is logged in the Event Log. If a human hits the pick timeout, they will automatically select the first card on their screen and pass their pack.
    • Sealed — host generates pools; each client receives their sealed pool and is dropped into the deck editor to build.
Screenshot 2026-04-21 061041 Screenshot 2026-04-21 062702
  1. Deckbuilding. On draft/sealed completion every participant's pool is saved as a deck on their local device. Each deck is tagged with metadata including event id, format, product (block + set combo), and timestamp. Players are taken immediately to offline deck builder. Players can also access decks later under a shared Draft/Sealed Decks section in multiplayer menu.
  2. Match setup
    • If playing immediately after draft, lobby will automatically filter deck selector to match the metadata for the event. The host can disable this with "Only allow decks from this event" checkbox.
    • Alternatively if playing games in separate session from draft, host can load a previous event from the "Setup Event" button, which will let them choose any event matching metadata in decks saved on their device.
    • Standard match procedure follows.

🤖 Generated with Claude Code

MostCromulent and others added 2 commits April 20, 2026 21:58
Host-driven multiplayer draft and sealed in the online lobby:
- Draft engine runs on the host; clients submit picks as NetEvents and
  receive packs via DraftPackArrivedEvent
- Per-seat disconnect grace window (configurable) with auto-pick
  fallback after grace; reconnect resumes live picking without reclaim
  timer or /skipreconnect interference
- Live FDraftOverlay shows pack/pick and neighbor queue depths; event
  log tinted per seat with pack-M/pick-N notation and [N waiting] badge
- Sealed path generates and delivers ReceiveEventPoolEvent pools to
  each seat; both sides transition to the deck editor automatically
- Event results saved as plain Decks with metadata tags (eventId,
  format, product, date); host picks an event for the follow-on match
  via a dropdown filtered from saved tags

Mobile port deferred — desktop-only for this PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Build the BoosterDraft at pool-type selection so block/set sub-dialogs fire
  before the timer prompt, matching the offline CSubmenuDraft flow.
- Show the chosen block plus set-combo (e.g. "Mirrodin (MRD, DST, 5DN)") in
  the config panel's product row, for both draft and sealed.
- Shorten event deck names to "Format - Product - YYYY-MM-DD"; metadata
  tags keep the full timestamp.
- Preserve the client's deck selection across lobby updates by matching
  on deck name instead of the (rebuilt) DeckProxy reference.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MostCromulent MostCromulent changed the title Add draft and sealed modes to online multiplayer Add draft and sealed modes to online multiplayer (desktop) Apr 21, 2026
@tool4ever tool4ever requested a review from tehdiplomat April 21, 2026 20:08
Comment thread forge-gui/src/main/java/forge/gamemodes/net/server/FServerManager.java Outdated
MostCromulent and others added 3 commits April 22, 2026 07:13
The Consumer<ILobbyListener> param on sendToSlot duplicated
dispatchToLocalListener, which already type-switches the event to the
right listener method. Drop the param; the local branch delegates to
dispatchToLocalListener.

Also extract EventParticipant.findBySeat to replace a near-identical
private helper in BoosterDraftHost and a static duplicate in VLobby.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fold "not yet drafted" / "pools not yet generated" into the Date row;
State 0 shows a unified centered "waiting" message. Title + X wrapped
in a nested panel so hiding the X doesn't break row flow.

Also fix: client variants bar now hides when host switches to Limited.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Restructure the network lobby along Forge's standard V/C separation:
  VLobby holds only widget construction and render methods; CLobby owns
  lobby state (mode, active/configured event, draft editor, seat/pack
  tracking) and lifecycle (mode change, event create / load / dismiss,
  conformance, start, draft pack/pick/auto-pick, pool reception).
  Event panel rendering is two-step: CLobby.buildEventPanelContents
  computes, VLobby.setEventPanelContents renders.

- Extract platform-agnostic event logic into forge-gui so a future
  mobile online draft/sealed implementation can consume it verbatim:
  NetworkEvent.{findEventTags, getEventDisplayLabel, computeEventPanelText,
  EventChoice, EventPanelText}, EventParticipant.resolveName, and
  GameLobby.findFirstUnreadySlot. NetworkEvent's javadoc updated to
  document its dual role as event model plus cross-platform helpers.

No behaviour changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MostCromulent MostCromulent added Drafting Related to Draft(ing) game mechanic Netplay labels Apr 24, 2026
tool4ever and others added 2 commits April 27, 2026 20:12
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Drafting Related to Draft(ing) game mechanic Netplay

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants