Skip to content

fix: backlog draining, per-bracket viability and matcher-aware waiter counts#13

Merged
FrancescoBorzi merged 2 commits into
mainfrom
misc-fixes
Jul 6, 2026
Merged

fix: backlog draining, per-bracket viability and matcher-aware waiter counts#13
FrancescoBorzi merged 2 commits into
mainfrom
misc-fixes

Conversation

@FrancescoBorzi

@FrancescoBorzi FrancescoBorzi commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added/expanded AFK skipping guidance and new tuning for skipping AFK and auras, including expected client timing behavior.
    • Automatic queueing can open additional battleground instances during an active pass when enough eligible players remain.
  • Bug Fixes

    • Improved cross-faction behavior and clarified what happens under misconfiguration and when toggled at runtime.
    • Tightened bracket eligibility, waiter counting, and parity handling for more consistent queue matching.
    • Clarified the “manual re-join” limitation while an automatic queue spot is held.
  • Documentation

    • Updated config template and how-it-works instructions with clearer operator/player-facing explanations and chat skip reasons.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eda33a9e-c875-4957-82be-7a2322eefdbd

📥 Commits

Reviewing files that changed from the base of the PR and between f6fa856 and fa3f1ff.

📒 Files selected for processing (1)
  • src/BgAutoQueue.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/BgAutoQueue.cpp

📝 Walkthrough

Walkthrough

Reworks BgAutoQueue’s internal queue bookkeeping to store cached player state, add bracket-relative CFBG-aware waiter counting, revise viability and parity logic, and schedule backlog drains. It also updates config handling, operator messages, and documentation for the new behavior.

Changes

BgAutoQueue core logic and docs

Layer / File(s) Summary
Config loading, CFBG flags, and pool resolution
src/BgAutoQueue.cpp, src/BgAutoQueue.h
Adds config parsing clamps and CF* config reads, resets warn-once flags on reload, and reworks pool resolution logging and validation.
BucketMember data model and bracket-relative waiter counting
src/BgAutoQueue.h, src/BgAutoQueue.cpp
Introduces cached per-member level/team storage, updates fit checks to read it, and rewrites uninvited waiter counting to be bracket- and CFBG-aware with stale-bucket warnings.
Viability, selection, and deserter template checks
src/BgAutoQueue.h, src/BgAutoQueue.cpp
Rewrites IsViable() to partition by bracket, restricts waiter-leader selection to the configured pool, and replaces the fixed WS deserter check with a dynamic template lookup.
Queue-time revalidation, parity trimming, and pending drain scheduling
src/BgAutoQueue.h, src/BgAutoQueue.cpp, src/cs_bg_auto_queue.cpp
Adjusts queue-time revalidation, redesigns strict EvenTeams parity trimming per bracket, adds pending-drain registration and update handling, wires drain checks into Update(), and refreshes skip-report messages.
Documentation of new behavior
README.md, conf/mod-bg-auto-queue.conf.dist, docs/how-it-works.md
Documents seeded below-minimum queues, CFBG toggling caveats, multi-instance drain behavior, SkipAFK/SkipAuras options, and manual re-join rejection while holding an auto-queue slot.

Estimated code review effort: 4 (Complex) | ~60 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: backlog draining, per-bracket viability, and matcher-aware waiter counting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch misc-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@FrancescoBorzi FrancescoBorzi requested a review from Copilot July 6, 2026 15:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/BgAutoQueue.cpp`:
- Around line 232-235: Apply the runtime-disable gate consistently in
ResolvePool() and UpdatePendingDrains() so disabled battleground entries are not
retained or scheduled. When
sDisableMgr->IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, ...) is true, skip pushing
the bgTypeId into _pool and ensure the pending-drain path also filters disabled
entries before selection, using the same BgAutoQueue logic and pool-building
flow so reloads cannot keep scheduling disabled BGs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 11ca9199-9a25-47fe-afc0-82624c917f60

📥 Commits

Reviewing files that changed from the base of the PR and between 6d709fb and f6fa856.

📒 Files selected for processing (6)
  • README.md
  • conf/mod-bg-auto-queue.conf.dist
  • docs/how-it-works.md
  • src/BgAutoQueue.cpp
  • src/BgAutoQueue.h
  • src/cs_bg_auto_queue.cpp

Comment thread src/BgAutoQueue.cpp

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the battleground auto-queue module’s reliability and operator visibility by making viability and waiter-counting bracket-accurate (and matcher-aware), and by actively draining large backlogs after a queue pass so multiple instances can open quickly when enough players remain queued.

Changes:

  • Added per-candidate-bracket partitioning for viability/parity decisions and updated waiter counting to only include queue buckets the active matcher can actually pop.
  • Implemented post-pass backlog draining that periodically re-schedules queue updates while a bracket still has enough uninvited waiters for another instance.
  • Expanded operator-facing messages and documentation around AFK skipping, pool resolution/disable handling, CFBG.Enable toggles, and manual re-join behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/cs_bg_auto_queue.cpp Refines .bgevents run output to better explain skip/drop reasons.
src/BgAutoQueue.h Adds bracket partitioning + pending-drain APIs/state and clarifies behavior in comments.
src/BgAutoQueue.cpp Implements matcher-aware waiter counting, per-bracket viability, deserter-template selection, timer clamping, and backlog draining.
README.md Documents new selection/reinforcement behavior and operational caveats.
docs/how-it-works.md Adds AFK skip explanation and clarifies manual re-join limitations after auto-queue.
conf/mod-bg-auto-queue.conf.dist Documents seeded-queue side effects, pool validation behavior, and AFK skip wording.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/BgAutoQueue.cpp
@FrancescoBorzi FrancescoBorzi merged commit 1611f93 into main Jul 6, 2026
2 checks passed
@FrancescoBorzi FrancescoBorzi deleted the misc-fixes branch July 6, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants