fix: scope randombot ownership by realm#2284
Open
scarecr0w12 wants to merge 12 commits intomod-playerbots:test-stagingfrom
Open
fix: scope randombot ownership by realm#2284scarecr0w12 wants to merge 12 commits intomod-playerbots:test-stagingfrom
scarecr0w12 wants to merge 12 commits intomod-playerbots:test-stagingfrom
Conversation
Master update from Test-staging: Fix ObjectAccessor retrieval, optimize EquipActions, and implement RaidBossHelpers
This reverts commit c86032f.
Master update from Test staging
Update master from Test staging and Core Update
Test staging to master
Test staging to master
Author
|
Updated the PR with the latest realm-scoped randombot ownership changes. Included in this update:
Validation completed:
|
Collaborator
|
You are running multiple world-servers against the same database? |
Author
Shared Auth, Separate Character/World |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
This change prevents one worldserver from deleting another worldserver's randombot auth accounts when both realms share the same auth database.
It adds a shared auth-db ownership table,
playerbots_account_ownership, keyed by account ID and ownedRealmID, and updates randombot account creation, assignment, and deletion to operate only on accounts owned by the current realm.For pre-existing legacy
rndbot*accounts, the code will auto-adopt only accounts that are clearly attributable to a single realm. If an account has characters on multiple realms, it is treated as ambiguous and skipped instead of being auto-claimed.Feature Evaluation
Describe the minimum logic required to achieve the intended behavior.
RealmID.Describe the processing cost when this logic executes across many bots.
rndbot*accounts on startup, but it does not add meaningful per-bot/per-trigger runtime overhead once the bot population is active.How to Test the Changes
RealmIDvalues sharing the same auth DB.playerbots_account_ownershipto the shared auth database.AiPlayerbot.DeleteRandomBotAccounts = 1on server A and restart it.rndbot*account with characters on multiple realms and restart a patched server.Additional validation completed in this workspace:
worldserversuccessfully after the code changes.acore_auth.playerbots_account_ownershiptable and verified the server starts with the new logic.Impact Assessment
Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots?
Explanation: the extra work happens during account adoption/discovery at startup and delete flows, not inside normal per-bot decision making or tick processing.
Does this change modify default bot behavior?
Explanation: randombot account reuse, assignment, and deletion are now realm-scoped instead of global across all
rndbot*auth accounts.Does this change add new decision branches or increase maintenance complexity?
Explanation: there is added migration/ownership logic for legacy shared-auth setups, including ambiguous-account detection for accounts with characters on multiple realms.
AI Assistance
Was AI assistance used while working on this change?
Purpose of usage: investigation, code generation, and PR drafting.
Influenced/generated areas: ownership-table SQL, randombot account ownership/adoption logic, and PR text.
All generated code was reviewed, adjusted, rebuilt, and validated before submission.
Final Checklist
Notes for Reviewers
test-stagingas requested by the repository template.sql/auth/base/playerbots_account_ownership.sqlsql/auth/updates/2026_04_04_00_playerbots_account_ownership.sql