Core changes for mod‑playerbots (Changelog)
This is a compact changelog of AzerothCore core modifications required by the Playerbot core branch to support mod‑playerbots.
Build / CMake
- Detect
mod-playerbotsmodule and defineMOD_PLAYERBOTSfor relevant targets. - Link
moduleswithmysqlwhen playerbots is present.
Databases
- Add a new DB pool (guarded by
MOD_PLAYERBOTS): DatabaseWorkerPool<PlayerbotsDatabaseConnection> PlayerbotsDatabase- Extend DB forward declarations and alias types for prepared statements/transactions/query holders.
- Extend
DatabaseLoader: - new flag
DATABASE_PLAYERBOTS DATABASE_MASK_ALLincludes playerbots (when enabled)- add
SetUpdateFlags()to OR‑in flags - add template instantiation for
AddDatabase<PlayerbotsDatabaseConnection>()
DB lifecycle hooks (DatabaseScript)
Add new DatabaseScript hook points + ScriptMgr forwarders:
OnDatabasesLoading()(bool gate)OnDatabasesKeepAlive()OnDatabasesClosing()OnDatabaseWarnAboutSyncQueries(bool)OnDatabaseSelectIndexLogout(Player*, uint32&, uint32&)OnDatabaseGetDBRevision(std::string&)
Integrate in worldserver:
- Call
OnDatabasesLoading()after DB loader load and abort startup on failure. - Call
OnDatabasesClosing()on shutdown. - Forward sync‑query warning toggles into scripts.
Logging
- Add
Appender.PlayerbotsandLogger.playerbots(dedicatedPlayerbots.log).
Scripting: PlayerbotScript family
- Add
PlayerbotScripttype and registration. - Add
ScriptMgrdispatch methods: - LFG queue check, kill task check, petition account check
- bot update cadence, per‑session update
- bot logout (single + all)
- packet‑sent callback
Networking / Sessions
WorldSession:- add
isBotconstructor parameter +_isBotflag - set address to
"bot"for bot sessions without real socket address - add
IsBot(),SetAddress(...), expose packet queue accessor - guard against
NULL_OPCODEinSendPacket()(log + return) - call
OnPlayerbotPacketSent(...)on outgoing packets WorldSession::Update():- call
ScriptMgr::OnPacketReceived(...)for inbound packets behindMOD_PLAYERBOTS WorldSessionMgr::KickAll():- call
OnPlayerbotLogoutBots()behindMOD_PLAYERBOTS
Player hooks
- Add
PlayerScript::OnPlayerAfterUpdate(...) - Add additional chat hook enums:
OnChat,OnChatWithReceiver,OnChatWithGroup,OnChatWithGuild,OnChatWithChannel
Movement
PointMovementGenerator:- support inverted spline orientation via
SetOrientationInversed()when_reverseOrientationis set