Playerbot: wire AddonControl::OnSessionLogout on owner logout (fixes .so load)
AddonControl.o was never pulled into the worldserver binary: nothing in the worldserver link referenced its symbols (OnAddonWhisper is only called from the scripts module, OnSessionLogout was declared but never called), so -rdynamic could not export OnAddonWhisper and libscripts_commands.so failed to load with 'undefined symbol'. OnPlayerLogout now calls AddonControl::OnSessionLogout for real players (its documented purpose), anchoring AddonControl.o into the worldserver link so both symbols are exported.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "PlayerbotV2.h"
|
||||
#include "PlayerbotHooks.h"
|
||||
#include "Services.h"
|
||||
#include "Session/AddonControl.h"
|
||||
#include "Bot/BotRegistry.h"
|
||||
#include "Bot/BotSnapshot.h"
|
||||
#include "Bot/ClassTables.h"
|
||||
@@ -2758,6 +2759,11 @@ void Module::OnPlayerLogout(Player* p)
|
||||
if (WorldSession const* sess = p->GetSession(); sess && !sess->IsBot())
|
||||
{
|
||||
uint32 const owner_account = sess->GetAccountId();
|
||||
// Reap the addon's per-account reassembly state / retry spool
|
||||
// (per AddonControl.h contract). This reference also anchors
|
||||
// AddonControl.o into the worldserver link so -rdynamic exports
|
||||
// OnAddonWhisper for the scripts module to resolve at load.
|
||||
AddonControl::OnSessionLogout(owner_account);
|
||||
auto alts = Services::Altbots().AltsOfAccount(owner_account);
|
||||
for (BotId bot_id : alts)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user