mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: fire PLAYER_ENTERING_WORLD and critical login events for addons
PLAYER_ENTERING_WORLD is the single most important WoW addon event — virtually every addon registers for it to initialize UI, state, and data structures. It was never fired, causing widespread addon init failures on login and after teleports. Now fired from: - handleLoginVerifyWorld (initial login + same-map teleports) - handleNewWorld (cross-map teleports, instance transitions) Also fires: - PLAYER_LOGIN on initial world entry only - ZONE_CHANGED_NEW_AREA on all world entries - UPDATE_WORLD_STATES on initial entry - SPELLS_CHANGED + LEARNED_SPELL_IN_TAB after SMSG_INITIAL_SPELLS (so spell book addons can initialize on login)
This commit is contained in:
parent
5086520354
commit
73ce601bb5
1 changed files with 25 additions and 0 deletions
|
|
@ -9744,6 +9744,19 @@ void GameHandler::handleLoginVerifyWorld(network::Packet& packet) {
|
|||
LOG_INFO("Auto-requested played time on login");
|
||||
}
|
||||
}
|
||||
|
||||
// Fire PLAYER_ENTERING_WORLD — THE most important event for addon initialization.
|
||||
// Fires on initial login, teleports, instance transitions, and zone changes.
|
||||
if (addonEventCallback_) {
|
||||
addonEventCallback_("PLAYER_ENTERING_WORLD", {initialWorldEntry ? "1" : "0"});
|
||||
// Also fire ZONE_CHANGED_NEW_AREA and UPDATE_WORLD_STATES so map/BG addons refresh
|
||||
addonEventCallback_("ZONE_CHANGED_NEW_AREA", {});
|
||||
addonEventCallback_("UPDATE_WORLD_STATES", {});
|
||||
// PLAYER_LOGIN fires only on initial login (not teleports)
|
||||
if (initialWorldEntry) {
|
||||
addonEventCallback_("PLAYER_LOGIN", {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameHandler::handleClientCacheVersion(network::Packet& packet) {
|
||||
|
|
@ -19318,6 +19331,12 @@ void GameHandler::handleInitialSpells(network::Packet& packet) {
|
|||
loadSkillLineAbilityDbc();
|
||||
|
||||
LOG_INFO("Learned ", knownSpells.size(), " spells");
|
||||
|
||||
// Notify addons that the full spell list is now available
|
||||
if (addonEventCallback_) {
|
||||
addonEventCallback_("SPELLS_CHANGED", {});
|
||||
addonEventCallback_("LEARNED_SPELL_IN_TAB", {});
|
||||
}
|
||||
}
|
||||
|
||||
void GameHandler::handleCastFailed(network::Packet& packet) {
|
||||
|
|
@ -23635,6 +23654,12 @@ void GameHandler::handleNewWorld(network::Packet& packet) {
|
|||
if (worldEntryCallback_) {
|
||||
worldEntryCallback_(mapId, serverX, serverY, serverZ, isSameMap);
|
||||
}
|
||||
|
||||
// Fire PLAYER_ENTERING_WORLD for teleports / zone transitions
|
||||
if (addonEventCallback_) {
|
||||
addonEventCallback_("PLAYER_ENTERING_WORLD", {"0"});
|
||||
addonEventCallback_("ZONE_CHANGED_NEW_AREA", {});
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue