Reason: after its owner used Uninvite on a companion bot, the bot kept following the owner for as long as the owner binding stood.
Why: nothing reacted to the group removal; only .bot dismiss released a companion.
Fix: a group hook releases an owned companion that the owner kicks or that leaves the group: it says goodbye and logs out, and the owner and saved mark stay, so .bot call brings it back. Battleground groups, a bot that is logging out, internal removals and kicks by anyone but the owner do nothing.
src/server/game/Playerbot (PlayerbotAPI, bot movement, item scorer, Classic
spec/supplies/talent tables, ...) is now src/modules/PlayerbotV2/Api, and the
.playerbot/.bot commands are src/modules/PlayerbotV2/Commands. The module
registers its commands itself; PlayerbotHooks is gone.
Core:
- PathGenerator: the bot-only liquid avoidance is an optional
LiquidRouteCheck callback the module sets.
- Debug probe logging removed from chat, group, inspect, party packets and
the session packet loop.
- .learn all mylevel moved into the module (same name and permission).
- .summon is the stock GM command again. Removed the auth update that gave
every player .summon (only a module check kept them from summoning real
players). Players call their own bots with .bot summon all|saved|<name>;
the ForeverBots "Call saved" button uses it.
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).