Skip to content

feat: better opt-out hint + auto opt-out after repeated declines#16

Merged
FrancescoBorzi merged 2 commits into
mainfrom
better-opt-out
Jul 10, 2026
Merged

feat: better opt-out hint + auto opt-out after repeated declines#16
FrancescoBorzi merged 2 commits into
mainfrom
better-opt-out

Conversation

@FrancescoBorzi

@FrancescoBorzi FrancescoBorzi commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added an optional chat hint explaining how to disable future auto-invites after declining.
    • Players are automatically opted out after a configurable number of consecutive declined/ignored module invites (with persistence based on the core player settings).
    • Accepting an invite or using .bgevents on resets the decline count and re-enables invitations.
    • Automatic opt-outs now show a distinct status/skip message.
  • Documentation

    • Updated configuration and operational guidance for the decline hint, auto-opt-out threshold, persistence details, and manual group queuing.
  • Chores

    • Updated ignore rules to prevent .claude from being tracked by Git.

@coderabbitai

coderabbitai Bot commented Jul 10, 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: 96c4501f-4519-4957-bdb7-1ba25f33738f

📥 Commits

Reviewing files that changed from the base of the PR and between 8e3e6e0 and 80e3b72.

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

📝 Walkthrough

Walkthrough

The module now tracks module-created battleground invites, counts consecutive declines, sends configurable hints, and automatically opts players out after a threshold. PlayerSettings persistence, lifecycle hooks, command messaging, configuration, documentation, and .claude ignore handling were updated.

Changes

Decline-driven invite handling

Layer / File(s) Summary
Settings and configuration contract
src/BgAutoQueue.h, conf/mod-bg-auto-queue.conf.dist, README.md, docs/how-it-works.md
Adds decline-count state, auto-opt-out semantics, configurable hints and thresholds, persistence documentation, and updated invite behavior guidance.
Tracked queue decline workflow
src/BgAutoQueue.cpp
Tracks module-created queues, validates invite outcomes, resets counts on acceptance, increments consecutive declines, sends notices, and applies automatic opt-out.
Player lifecycle hook integration
src/mod_bg_auto_queue_scripts.cpp
Registers player hooks for battlefield ports, invite expiry, and logout cleanup.
Opt-out status feedback
src/cs_bg_auto_queue.cpp
Displays distinct command feedback for automatic versus manual opt-out states.
Repository ignore update
.gitignore
Adds .claude to the ignored repository entries.

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

Sequence Diagram(s)

sequenceDiagram
  participant Player
  participant mod_bg_auto_queue_player
  participant BgAutoQueue
  participant GroupQueueInfo
  Player->>mod_bg_auto_queue_player: Respond to or leave battleground invite
  mod_bg_auto_queue_player->>BgAutoQueue: Forward battlefield or expiry event
  BgAutoQueue->>GroupQueueInfo: Validate tracked queue and invite timing
  BgAutoQueue->>BgAutoQueue: Update decline count or opt-out state
  BgAutoQueue->>Player: Send hint or automatic opt-out notice
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: improved opt-out hints and automatic opt-out after repeated declines.
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 better-opt-out

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.

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 enhances the battleground auto-queue module’s opt-out UX by (1) showing a clearer hint after declined/expired invites and (2) automatically opting a character out after a configurable number of consecutive declined/ignored module invites, while keeping manual queues unaffected.

Changes:

  • Add a PlayerScript to observe battlefield port actions, invite expiry desertion, and logout for per-player decline tracking and cleanup.
  • Extend PlayerSettings usage to track consecutive declines and distinguish manual opt-out vs auto opt-out (with updated .bgevents status messaging).
  • Document and expose new configuration options (BgAutoQueue.DeclineHint.Enable, BgAutoQueue.OptOutAfterDeclines) across README/docs/conf.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/mod_bg_auto_queue_scripts.cpp Adds player hooks to feed invite/decline/expiry/logout events into the module for tracking.
src/cs_bg_auto_queue.cpp Updates .bgevents status output to distinguish auto opt-out messaging from manual opt-out.
src/BgAutoQueue.h Introduces PlayerSettings indices for decline count + auto opt-out state and adds tracked-queue bookkeeping.
src/BgAutoQueue.cpp Implements decline counting, auto opt-out, player-facing hint/notice messages, and tracked queue identity validation.
README.md Documents the decline hint + auto opt-out behavior and how PlayerSettings indices are used.
docs/how-it-works.md Updates user-facing explanation of declining behavior and automatic opt-out semantics.
conf/mod-bg-auto-queue.conf.dist Adds and documents new config knobs for hints and auto opt-out threshold.
.gitignore Ignores .claude local artifact.

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

@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 1083-1099: Update SendOptOutNotice to accept the actual decline
count as a parameter, propagate the count from OnModuleInviteDeclined at the
call site, and use that parameter in the player-facing StringFormat message
instead of _optOutAfterDeclines; update the declaration in BgAutoQueue.h
accordingly.
🪄 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: 3c8d4edf-7d2a-4c36-a83f-970e5246dccf

📥 Commits

Reviewing files that changed from the base of the PR and between 7d5af48 and 8e3e6e0.

📒 Files selected for processing (8)
  • .gitignore
  • 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
  • src/mod_bg_auto_queue_scripts.cpp

Comment thread src/BgAutoQueue.cpp Outdated
@FrancescoBorzi FrancescoBorzi merged commit 0759baa into main Jul 10, 2026
2 checks passed
@FrancescoBorzi FrancescoBorzi deleted the better-opt-out branch July 10, 2026 11:53
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