feat(Core/Playerbots): add auction house botting#2
Conversation
…on threshold logic
🤖 Augment PR SummarySummary: Adds opt-in auction house botting for playerbots and wires it into existing RPG/travel behavior. Changes:
Technical Notes: Uses 🤖 Was this summary useful? React with 👍 or 👎 |
| } | ||
| case RPG_FARMING: | ||
| { | ||
| <<<<<<< HEAD |
There was a problem hiding this comment.
| { | ||
| auto& data = std::get<NewRpgInfo::GoGrind>(info.data); | ||
| WorldPosition& originalPos = data.pos; | ||
| assert(data.pos != WorldPosition()); |
There was a problem hiding this comment.
In RPG_GO_GRIND (and similarly RPG_GO_CAMP), data/originalPos are referenced after their declarations were removed, so this code won’t compile and the status transition logic can’t run. Consider restoring the correct std::get<...>(info.data) and originalPos bindings for each case.
Severity: high
Other Locations
src/Ai/World/Rpg/Action/NewRpgAction.cpp:89src/Ai/World/Rpg/Action/NewRpgAction.cpp:97
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| return snapshot; | ||
|
|
||
| uint64 totalUnitBuyout = 0; | ||
| for (auto itr = auctionHouse->GetAuctionsBegin(); itr != auctionHouse->GetAuctionsEnd(); ++itr) |
There was a problem hiding this comment.
This iterates AuctionHouseObject directly; if playerbot AI runs in map threads while auctions are mutated in the world thread, this can race and invalidate iterators/pointers. Consider ensuring auction scanning/snapshotting happens on the world thread or under the same synchronization used for auction mutations.
Severity: medium
Other Locations
src/Ai/Base/Actions/BuyAction.cpp:275src/Ai/Base/Actions/SellAction.cpp:95
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
… idempotency ## Critical Fixes Applied ### 1. Fix GetCurrentRealmId() source of truth (Issue #1) - Changed from sConfigMgr config read to global realm.Id.Realm - Fixes default mismatch (0 vs 1) that caused realm ID collisions - Added Realm.h include for proper type consistency - Added validation: refuse ownership operations if realm ID is 0 - Added error logging to alert misconfigured systems ### 2. Make base SQL idempotent (Issue #2) - Removed destructive DROP TABLE IF EXISTS from base schema - Changed to CREATE TABLE IF NOT EXISTS - Prevents data loss if schema hash changes trigger re-apply - Applied to: data/sql/auth/base/playerbots_account_ownership.sql ### 3. Add guard clauses for invalid realm IDs - GetOwnedRandomBotAccounts(): Refuse to fetch if realmId == 0 - CreateRandomBots(): Refuse to create/delete if realmId == 0 - Includes error logging for each guard ### 4. Remove legacy redundant sql/ folder - Commit 76b7815 migrated everything to data/sql/ per AzerothCore standards - sql/ was accidentally populated in this PR (duplicates only) - Removed sql/auth/* files to maintain single source of truth ## Validation - Code follows AzerothCore realm ID patterns (realm.Id.Realm) - SQL schema now safe for multi-realm, multi-apply scenarios - No longer possible to silently reintroduce cross-realm destruction Fixes review comments from Celandriel (automated code review)
Summary
This PR adds auction house botting on top of the farming RPG base branch.
It includes:
Depends On
Base branch:
feature/playerbot-farming-rpg-splitScope
Testing
Not run during branch split. Recommend build plus targeted in-game validation of:
Notes
This PR is intentionally stacked on the farming RPG branch so the dependency is explicit and reviewable.