mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Request completed quests on world entry and expose via public API
- Send CMSG_QUERY_QUESTS_COMPLETED on initial world entry so completedQuests_ is populated from the server response - Clear completedQuests_ on world entry to avoid stale data across sessions - Add isQuestCompleted(questId) and getCompletedQuests() public accessors to allow UI layers to filter NPC quest offers by completion state
This commit is contained in:
parent
bbfb170291
commit
28c755040f
2 changed files with 12 additions and 0 deletions
|
|
@ -508,6 +508,10 @@ public:
|
|||
const std::vector<AuraSlot>& getPlayerAuras() const { return playerAuras; }
|
||||
const std::vector<AuraSlot>& getTargetAuras() const { return targetAuras; }
|
||||
|
||||
// Completed quests (populated from SMSG_QUERY_QUESTS_COMPLETED_RESPONSE)
|
||||
bool isQuestCompleted(uint32_t questId) const { return completedQuests_.count(questId) > 0; }
|
||||
const std::unordered_set<uint32_t>& getCompletedQuests() const { return completedQuests_; }
|
||||
|
||||
// NPC death callback (for animations)
|
||||
using NpcDeathCallback = std::function<void(uint64_t guid)>;
|
||||
void setNpcDeathCallback(NpcDeathCallback cb) { npcDeathCallback_ = std::move(cb); }
|
||||
|
|
|
|||
|
|
@ -5238,7 +5238,15 @@ void GameHandler::handleLoginVerifyWorld(network::Packet& packet) {
|
|||
pendingQuestQueryIds_.clear();
|
||||
pendingLoginQuestResync_ = true;
|
||||
pendingLoginQuestResyncTimeout_ = 10.0f;
|
||||
completedQuests_.clear();
|
||||
LOG_INFO("Queued quest log resync for login (from server quest slots)");
|
||||
|
||||
// Request completed quest IDs from server (populates completedQuests_ when response arrives)
|
||||
if (socket) {
|
||||
network::Packet cqcPkt(wireOpcode(Opcode::CMSG_QUERY_QUESTS_COMPLETED));
|
||||
socket->send(cqcPkt);
|
||||
LOG_INFO("Sent CMSG_QUERY_QUESTS_COMPLETED");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue