Skip to content

feat(gamemode): run the queue engine per gamemode - #820

Open
garrappachc wants to merge 2 commits into
feat/gamemode-skillfrom
feat/gamemode-queue-engine
Open

garrappachc wants to merge 2 commits into
feat/gamemode-skillfrom
feat/gamemode-queue-engine

Conversation

@garrappachc

Copy link
Copy Markdown
Member

Part of the multi-gamemode (5.0.0) stack. Base: #819.

Why

Makes the queue engine operate per gamemode so an instance can run more than one queue at once (6v6/9v9/ultiduo/bball) — the first PR in the stack that can actually drive >1 queue.

What

  • gamemode threaded through the queue engine (queue/*, queue-auto/*): state, slots, map-vote, friendships and their reads/writes are now filtered by gamemode.
  • Per-gamemode mutex; per-gamemode ready/launch driver (auto-update-queue-state); queue:readyUpTimeout / queue:unready tasks carry the gamemode in their args.
  • One queue initialised per ENABLED_GAMEMODES entry at boot; game launch/reset scoped to the launching queue's gamemode.\n- Queue events (queue/slots:updated, queue/state:updated, queue/mapOptions:reset, queue/mapVoteResults:updated, queue/friendship:*) now carry gamemode.\n- Joining still vacates any slot the player holds in another gamemode (one-queue-at-a-time).\n\n## Boundary / scope\n- The websocket gateway and the /-page broadcast still pass the default gamemode; the real routed gamemode arrives with the queue-paths PR. Behaviour is unchanged for a single-gamemode instance.\n- The shared map pool stays global (a separate concern); only the per-queue vote options/votes are partitioned here.\n\nNet-new tsc errors: 0. Unit suite green without .env (mirrors CI unit job).

Thread `gamemode` through the whole queue engine so each enabled gamemode
runs an independent queue: state/slots/map-vote/friendship reads and writes
are filtered by gamemode, the mutex and the ready/launch driver are keyed by
gamemode, and one queue is initialised per enabled gamemode at boot. Queue
events now carry the gamemode they belong to, and the ready-up/unready tasks
carry it in their args. Joining still vacates any slot the player holds in
another gamemode, keeping the one-queue-at-a-time rule.

The websocket gateway boundary still passes the default gamemode (routing
that supplies the real gamemode lands with the queue paths PR); behaviour is
unchanged for a single-gamemode instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  246 passed

Details

stats  246 tests across 47 suites
duration  39 minutes, 21 seconds
commit  6c1ae5d

Comment thread src/queue-auto/kick.ts
Comment thread src/queue-auto/plugins/auto-cleanup-friendships.ts Outdated
…helper

kick() no longer takes a gamemode: a player is kicked from whichever queue
they're in (grouped by gamemode internally), which also drops the slot lookups
the ban/disconnect/replace callers had to do. Extract the duplicated
per-gamemode debounce map (auto-cleanup-friendships + launch-new-game) into a
`debounceLazy` helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant