Core/PacketIO: updated and enabled CMSG_QUEST_CONFIRM_ACCEPT

This commit is contained in:
MitchesD
2015-04-17 18:39:50 +02:00
parent 94c6dd81ce
commit 60a87b4e1c
6 changed files with 27 additions and 14 deletions
+1 -1
View File
@@ -16337,7 +16337,7 @@ void Player::SendQuestConfirmAccept(Quest const* quest, Player* receiver)
if (QuestTemplateLocale const* questTemplateLocale = sObjectMgr->GetQuestLocale(questID))
ObjectMgr::GetLocaleString(questTemplateLocale->LogTitle, localeConstant, questTitle);
WorldPackets::Quest::QuestConfirmAccept packet;
WorldPackets::Quest::QuestConfirmAcceptResponse packet;
packet.QuestID = questID;
packet.InitiatedBy = GetGUID();
packet.QuestTitle = questTitle;
+4 -7
View File
@@ -462,14 +462,11 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPackets::Quest::QuestLogRemove
}
}
void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
void WorldSession::HandleQuestConfirmAccept(WorldPackets::Quest::QuestConfirmAccept& packet)
{
uint32 questId;
recvData >> questId;
TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT questId = %u", packet.QuestID);
TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT questId = %u", questId);
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
if (Quest const* quest = sObjectMgr->GetQuestTemplate(packet.QuestID))
{
if (!quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
return;
@@ -481,7 +478,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
if (!_player->IsInSameRaidWith(originalPlayer))
return;
if (!originalPlayer->CanShareQuest(questId))
if (!originalPlayer->CanShareQuest(packet.QuestID))
return;
if (!_player->CanTakeQuest(quest, true))
@@ -470,7 +470,7 @@ WorldPacket const* WorldPackets::Quest::QuestUpdateComplete::Write()
return &_worldPacket;
}
WorldPacket const* WorldPackets::Quest::QuestConfirmAccept::Write()
WorldPacket const* WorldPackets::Quest::QuestConfirmAcceptResponse::Write()
{
_worldPacket << uint32(QuestID);
_worldPacket << InitiatedBy;
@@ -480,3 +480,8 @@ WorldPacket const* WorldPackets::Quest::QuestConfirmAccept::Write()
return &_worldPacket;
}
void WorldPackets::Quest::QuestConfirmAccept::Read()
{
_worldPacket >> QuestID;
}
+12 -2
View File
@@ -465,10 +465,10 @@ namespace WorldPackets
int32 QuestID = 0;
};
class QuestConfirmAccept final : public ServerPacket
class QuestConfirmAcceptResponse final : public ServerPacket
{
public:
QuestConfirmAccept() : ServerPacket(SMSG_QUEST_CONFIRM_ACCEPT, 21) { }
QuestConfirmAcceptResponse() : ServerPacket(SMSG_QUEST_CONFIRM_ACCEPT, 21) { }
WorldPacket const* Write() override;
@@ -476,6 +476,16 @@ namespace WorldPackets
int32 QuestID = 0;
std::string QuestTitle;
};
class QuestConfirmAccept final : public ClientPacket
{
public:
QuestConfirmAccept(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_CONFIRM_ACCEPT, std::move(packet)) { }
void Read() override;
int32 QuestID = 0;
};
}
}
+2 -2
View File
@@ -639,7 +639,7 @@ void OpcodeTable::Initialize()
DEFINE_OPCODE_HANDLER_OLD(CMSG_QUERY_SCENARIO_POI, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
DEFINE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Query::QueryTime, &WorldSession::HandleQueryTimeOpcode);
DEFINE_HANDLER(CMSG_QUERY_VOID_STORAGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::VoidStorage::QueryVoidStorage, &WorldSession::HandleVoidStorageQuery);
DEFINE_OPCODE_HANDLER_OLD(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept );
DEFINE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Quest::QuestConfirmAccept, &WorldSession::HandleQuestConfirmAccept);
DEFINE_HANDLER(CMSG_QUEST_GIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Quest::QuestGiverAcceptQuest, &WorldSession::HandleQuestgiverAcceptQuestOpcode);
DEFINE_HANDLER(CMSG_QUEST_GIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Quest::QuestGiverChooseReward, &WorldSession::HandleQuestgiverChooseRewardOpcode);
DEFINE_HANDLER(CMSG_QUEST_GIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Quest::QuestGiverCompleteQuest, &WorldSession::HandleQuestgiverCompleteQuest);
@@ -1588,7 +1588,7 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SCENE_OBJECT_PET_BATTLE_REPLACEMENTS_MADE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SCENE_OBJECT_PET_BATTLE_ROUND_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SCRIPT_CAST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SELL_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SELL_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEND_ITEM_PASSIVES, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEND_KNOWN_SPELLS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEND_RAID_TARGET_UPDATE_ALL, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
+2 -1
View File
@@ -368,6 +368,7 @@ namespace WorldPackets
namespace Quest
{
class QuestConfirmAccept;
class QuestGiverStatusQuery;
class QuestGiverStatusMultipleQuery;
class QuestGiverHello;
@@ -1205,7 +1206,7 @@ class WorldSession
void HandleQuestgiverCancel(WorldPacket& recvData);
void HandleQuestLogSwapQuest(WorldPacket& recvData);
void HandleQuestLogRemoveQuest(WorldPackets::Quest::QuestLogRemoveQuest& packet);
void HandleQuestConfirmAccept(WorldPacket& recvData);
void HandleQuestConfirmAccept(WorldPackets::Quest::QuestConfirmAccept& packet);
void HandleQuestgiverCompleteQuest(WorldPackets::Quest::QuestGiverCompleteQuest& packet);
void HandleQuestgiverQuestAutoLaunch(WorldPacket& recvPacket);
void HandlePushQuestToParty(WorldPacket& recvPacket);