.bgevents settings per account#14
Conversation
📝 WalkthroughWalkthroughThe bgevents opt-out mechanism is migrated from per-character storage via core PlayerSettings to an account-wide custom database table (mod_bg_auto_queue_account_settings). BgAutoQueue.h/.cpp implement in-memory account tracking and database persistence; command messages and documentation are updated accordingly. ChangesAccount-wide opt-out migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Player
participant CommandHandler as cs_bg_auto_queue
participant BgAutoQueue
participant Database as mod_bg_auto_queue_account_settings
Player->>CommandHandler: .bgevents off
CommandHandler->>BgAutoQueue: SetOptOut(accountId, true)
BgAutoQueue->>Database: REPLACE INTO opted_out=1
BgAutoQueue-->>CommandHandler: updated _optedOutAccounts
CommandHandler-->>Player: "opted out for your account"
Note over BgAutoQueue,Database: On config reload
BgAutoQueue->>Database: LoadAccountSettings query opted_out=1
Database-->>BgAutoQueue: account_id rows
BgAutoQueue->>BgAutoQueue: repopulate _optedOutAccounts
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| @@ -0,0 +1,5 @@ | |||
| CREATE TABLE IF NOT EXISTS `mod_bg_auto_queue_account_settings` ( | |||
There was a problem hiding this comment.
mmmh the whole idea behind using playersettings was that we would avoid a new table
|
thanks for this PR 🙏 however I'm not sure we wanted to go this way (see comment) |
This has been fully made by AI
I tested it, and it seems to work just fine.
I cannot stand in for the code itself.
This is just a proof of concept
Summary by CodeRabbit
New Features
Bug Fixes
Documentation