The core no longer calls Playerbot::Hooks. Events the module reacts to come
through ScriptMgr; PlayerbotV2Scripts.cpp forwards them to the module.
Existing hooks reused at the same place: player login, logout, level change,
repop, text emote, guild member added, unit damage.
New generic hooks, called where the bot calls were:
- PlayerScript: OnChatSent (say/yell, whisper, group, guild; after the
message was sent), OnAddonMessageSent (whisper, group), OnLootItem,
OnBattlegroundQueueJoin, OnBattlegroundInvite, OnBattlegroundPortFailed,
OnLfgJoin, OnLfgProposal
- UnitScript: OnUnitDeath
- GroupScript: OnSubgroupChange
- WorldScript: CanCreateBattleground
The human-only checks on queue joins moved into the module. Dropped the hit
outcome, energize and heal calls (only fed debug statistics). Bot code still in
src/server/game/Playerbot keeps PlayerbotHooks until it moves into the module.
src/modules: every folder with a CMakeLists.txt is added; a module registers its
library, script loader and configs with trinity_add_module(). worldserver links
the generated `modules` library, whose AddModuleScripts() runs after AddScripts()
and is empty when no module is built. Module configs go to worldserver.conf.d.
New WorldScript hooks: OnBeforeMapsUpdate (each tick, before the maps update)
and OnWorldInitialized (world loaded, before the network starts). The bot module
uses them instead of direct calls from World.cpp and Main.cpp. The world script
update is back at its place after the maps, as in forever.
Removed the unused ModuleManager, modules/Common and TestModule, and the bot
freeze dump and settings log from Main.cpp (the settings line moved into the
module).