diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2015-04-12 01:25:35 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2015-04-12 01:26:01 +0200 |
commit | 95bb20d0731dda4ca04f25c8e5c4fd78fa700112 (patch) | |
tree | def4f55164a484a3359229bc7c352028f009d121 /src/server/game/Handlers/QueryHandler.cpp | |
parent | b9063e5514ec81eb7eefcd2342da0f6dbbc39725 (diff) |
Core/PacketIO: Updated & enabled CMSG_QUERY_QUEST_COMPLETION_NPCS / SMSG_QUEST_COMPLETION_NPC_RESPONSE
Diffstat (limited to 'src/server/game/Handlers/QueryHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/QueryHandler.cpp | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 50848e51510..4f2a7608038 100644 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -288,45 +288,34 @@ void WorldSession::HandleQueryCorpseTransport(WorldPackets::Query::QueryCorpseTr SendPacket(response.Write()); } -void WorldSession::HandleQuestNPCQuery(WorldPacket& recvData) +void WorldSession::HandleQueryQuestCompletionNPCs(WorldPackets::Query::QueryQuestCompletionNPCs& queryQuestCompletionNPCs) { - uint32 count = recvData.ReadBits(24); - std::map<uint32, std::vector<uint32>> quests; + WorldPackets::Query::QuestCompletionNPCResponse response; - for (uint32 i = 0; i < count; ++i) + for (int32& QuestID : queryQuestCompletionNPCs.QuestCompletionNPCs) { - uint32 questId; - recvData >> questId; + WorldPackets::Query::QuestCompletionNPC questCompletionNPC; - if (!sObjectMgr->GetQuestTemplate(questId)) + if (!sObjectMgr->GetQuestTemplate(QuestID)) { - TC_LOG_DEBUG("network", "WORLD: Unknown quest %u in CMSG_QUERY_QUEST_COMPLETION_NPCS by %s", questId, _player->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("network", "WORLD: Unknown quest %u in CMSG_QUERY_QUEST_COMPLETION_NPCS by %s", QuestID, _player->GetGUID().ToString().c_str()); continue; } - auto creatures = sObjectMgr->GetCreatureQuestInvolvedRelationReverseBounds(questId); + questCompletionNPC.QuestID = QuestID; + + auto creatures = sObjectMgr->GetCreatureQuestInvolvedRelationReverseBounds(QuestID); for (auto it = creatures.first; it != creatures.second; ++it) - quests[questId].push_back(it->second); + questCompletionNPC.NPCs.push_back(it->second); - auto gos = sObjectMgr->GetGOQuestInvolvedRelationReverseBounds(questId); + auto gos = sObjectMgr->GetGOQuestInvolvedRelationReverseBounds(QuestID); for (auto it = gos.first; it != gos.second; ++it) - quests[questId].push_back(it->second | 0x80000000); // GO mask - } - - WorldPacket data(SMSG_QUEST_COMPLETION_NPC_RESPONSE, 3 + quests.size() * 14); - data.WriteBits(quests.size(), 23); + questCompletionNPC.NPCs.push_back(it->second | 0x80000000); // GO mask - for (auto it = quests.begin(); it != quests.end(); ++it) - data.WriteBits(it->second.size(), 24); - - for (auto it = quests.begin(); it != quests.end(); ++it) - { - data << uint32(it->first); - for (const auto& entry : it->second) - data << uint32(entry); + response.QuestCompletionNPCs.push_back(questCompletionNPC); } - SendPacket(&data); + SendPacket(response.Write()); } void WorldSession::HandleQuestPOIQuery(WorldPackets::Query::QuestPOIQuery& packet) |