Core/Misc:
- Updated and enabled CMSG_QUEST_PUSH_RESULT opcode - Update QuestPushReason enum for 6.2.0
This commit is contained in:
@@ -16426,19 +16426,16 @@ void Player::SendQuestConfirmAccept(Quest const* quest, Player* receiver)
|
||||
packet.QuestTitle = questTitle;
|
||||
|
||||
receiver->GetSession()->SendPacket(packet.Write());
|
||||
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT");
|
||||
}
|
||||
|
||||
void Player::SendPushToPartyResponse(Player* player, uint8 msg)
|
||||
void Player::SendPushToPartyResponse(Player* player, QuestPushReason reason)
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
WorldPackets::Quest::QuestPushResult data;
|
||||
WorldPackets::Quest::QuestPushResultResponse data;
|
||||
data.SenderGUID = player->GetGUID();
|
||||
data.Result = msg; // valid values: 0-8
|
||||
data.Result = reason; // valid values: 0-13
|
||||
SendDirectMessage(data.Write());
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_PUSH_RESULT");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1725,7 +1725,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SendQuestTimerFailed(uint32 questId);
|
||||
void SendCanTakeQuestResponse(QuestFailedReason msg) const;
|
||||
void SendQuestConfirmAccept(Quest const* quest, Player* receiver);
|
||||
void SendPushToPartyResponse(Player* player, uint8 msg);
|
||||
void SendPushToPartyResponse(Player* player, QuestPushReason reason);
|
||||
void SendQuestUpdateAddCredit(Quest const* quest, ObjectGuid guid, QuestObjective const& obj, uint16 count);
|
||||
void SendQuestUpdateAddPlayer(Quest const* quest, uint16 newCount, uint32 required);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPackets::Quest::QuestG
|
||||
Player* player = ObjectAccessor::FindPlayer(_player->GetDivider());
|
||||
if (player)
|
||||
{
|
||||
player->SendPushToPartyResponse(_player, QUEST_PARTY_MSG_ACCEPT_QUEST);
|
||||
player->SendPushToPartyResponse(_player, QUEST_PUSH_ACCEPTED);
|
||||
_player->SetDivider(ObjectGuid::Empty);
|
||||
}
|
||||
}
|
||||
@@ -586,35 +586,35 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||
|
||||
if (!receiver->SatisfyQuestStatus(quest, false))
|
||||
{
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_HAVE_QUEST);
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PUSH_ONQUEST);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (receiver->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE)
|
||||
{
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_FINISH_QUEST);
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PUSH_ALREADY_DONE);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!receiver->CanTakeQuest(quest, false))
|
||||
{
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_CANT_TAKE_QUEST);
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PUSH_INVALID);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!receiver->SatisfyQuestLog(false))
|
||||
{
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_LOG_FULL);
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PUSH_LOG_FULL);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!receiver->GetDivider().IsEmpty())
|
||||
{
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_BUSY);
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PUSH_BUSY);
|
||||
continue;
|
||||
}
|
||||
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_SHARING_QUEST);
|
||||
sender->SendPushToPartyResponse(receiver, QUEST_PUSH_SUCCESS);
|
||||
|
||||
if (quest->IsAutoAccept() && receiver->CanAddQuest(quest, true) && receiver->CanTakeQuest(quest, true))
|
||||
receiver->AddQuestAndCheckCompletion(quest, sender);
|
||||
@@ -629,19 +629,13 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
|
||||
void WorldSession::HandleQuestPushResult(WorldPackets::Quest::QuestPushResult& packet)
|
||||
{
|
||||
ObjectGuid guid;
|
||||
uint32 questId;
|
||||
uint8 msg;
|
||||
recvPacket >> guid >> questId >> msg;
|
||||
|
||||
if (!_player->GetDivider().IsEmpty() && _player->GetDivider() == guid)
|
||||
if (!_player->GetDivider().IsEmpty() && _player->GetDivider() == packet.SenderGUID)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(_player->GetDivider());
|
||||
if (player)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(_player->GetDivider()))
|
||||
{
|
||||
player->SendPushToPartyResponse(_player, msg);
|
||||
player->SendPushToPartyResponse(_player, static_cast<QuestPushReason>(packet.Result));
|
||||
_player->SetDivider(ObjectGuid::Empty);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,19 +68,22 @@ enum QuestFailedReason
|
||||
QUEST_ERR_HAS_IN_PROGRESS = 30 // "Progress Bar objective not completed"
|
||||
};
|
||||
|
||||
enum QuestShareMessages
|
||||
enum QuestPushReason
|
||||
{
|
||||
QUEST_PARTY_MSG_SHARING_QUEST = 0,
|
||||
QUEST_PARTY_MSG_CANT_TAKE_QUEST = 1,
|
||||
QUEST_PARTY_MSG_ACCEPT_QUEST = 2,
|
||||
QUEST_PARTY_MSG_DECLINE_QUEST = 3,
|
||||
QUEST_PARTY_MSG_BUSY = 4,
|
||||
QUEST_PARTY_MSG_LOG_FULL = 5,
|
||||
QUEST_PARTY_MSG_HAVE_QUEST = 6,
|
||||
QUEST_PARTY_MSG_FINISH_QUEST = 7,
|
||||
QUEST_PARTY_MSG_CANT_BE_SHARED_TODAY = 8,
|
||||
QUEST_PARTY_MSG_SHARING_TIMER_EXPIRED = 9,
|
||||
QUEST_PARTY_MSG_NOT_IN_PARTY = 10
|
||||
QUEST_PUSH_SUCCESS = 0, // "Sharing quest with %s..."
|
||||
QUEST_PUSH_INVALID = 1, // "%s is not eligible for that quest"
|
||||
QUEST_PUSH_ACCEPTED = 2, // "%s has accepted your quest"
|
||||
QUEST_PUSH_DECLINED = 3, // "%s has declined your quest"
|
||||
QUEST_PUSH_BUSY = 4, // "%s is busy"
|
||||
QUEST_PUSH_DEAD = 5, // "%s is dead."
|
||||
QUEST_PUSH_LOG_FULL = 6, // "%s's quest log is full"
|
||||
QUEST_PUSH_ONQUEST = 7, // "%s is already on that quest"
|
||||
QUEST_PUSH_ALREADY_DONE = 8, // "%s has completed that quest"
|
||||
QUEST_PUSH_NOT_DAILY = 9, // "That quest cannot be shared today"
|
||||
QUEST_PUSH_TIMER_EXPIRED = 10, // "Quest sharing timer has expired"
|
||||
QUEST_PUSH_NOT_IN_PARTY = 11, // "You are not in a party"
|
||||
QUEST_PUSH_DIFFERENT_SERVER_DAILY = 12, // "%s is not eligible for that quest today"
|
||||
QUEST_PUSH_NOT_ALLOWED = 13 // "That quest cannot be shared"
|
||||
};
|
||||
|
||||
enum QuestTradeSkill
|
||||
|
||||
@@ -495,10 +495,17 @@ void WorldPackets::Quest::QuestConfirmAccept::Read()
|
||||
_worldPacket >> QuestID;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Quest::QuestPushResult::Write()
|
||||
WorldPacket const* WorldPackets::Quest::QuestPushResultResponse::Write()
|
||||
{
|
||||
_worldPacket << SenderGUID;
|
||||
_worldPacket << uint8(Result);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
void WorldPackets::Quest::QuestPushResult::Read()
|
||||
{
|
||||
_worldPacket >> SenderGUID;
|
||||
_worldPacket >> QuestID;
|
||||
_worldPacket >> Result;
|
||||
}
|
||||
|
||||
@@ -485,10 +485,10 @@ namespace WorldPackets
|
||||
int32 QuestID = 0;
|
||||
};
|
||||
|
||||
class QuestPushResult final : public ServerPacket
|
||||
class QuestPushResultResponse final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
QuestPushResult() : ServerPacket(SMSG_QUEST_PUSH_RESULT, 16 + 1) { }
|
||||
QuestPushResultResponse() : ServerPacket(SMSG_QUEST_PUSH_RESULT, 16 + 1) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
@@ -503,6 +503,18 @@ namespace WorldPackets
|
||||
|
||||
WorldPacket const* Write() override { return &_worldPacket; }
|
||||
};
|
||||
|
||||
class QuestPushResult final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
QuestPushResult(WorldPacket&& packet) : ClientPacket(CMSG_QUEST_PUSH_RESULT, std::move(packet)) { }
|
||||
|
||||
void Read() override;
|
||||
|
||||
ObjectGuid SenderGUID;
|
||||
uint32 QuestID = 0;
|
||||
uint8 Result = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -648,7 +648,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_HANDLER(CMSG_QUEST_GIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Quest::QuestGiverStatusQuery, &WorldSession::HandleQuestgiverStatusQueryOpcode);
|
||||
DEFINE_HANDLER(CMSG_QUEST_LOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Quest::QuestLogRemoveQuest, &WorldSession::HandleQuestLogRemoveQuest);
|
||||
DEFINE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Query::QuestPOIQuery, &WorldSession::HandleQuestPOIQuery);
|
||||
DEFINE_OPCODE_HANDLER_OLD(CMSG_QUEST_PUSH_RESULT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult );
|
||||
DEFINE_HANDLER(CMSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Quest::QuestPushResult, &WorldSession::HandleQuestPushResult);
|
||||
DEFINE_HANDLER(CMSG_QUEUED_MESSAGES_END, STATUS_UNHANDLED, PROCESS_INPLACE, WorldPackets::Null, &WorldSession::Handle_NULL);
|
||||
DEFINE_HANDLER(CMSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Misc::RandomRollClient, &WorldSession::HandleRandomRollOpcode);
|
||||
DEFINE_HANDLER(CMSG_READY_CHECK_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Party::ReadyCheckResponseClient, &WorldSession::HandleReadyCheckResponseOpcode);
|
||||
|
||||
@@ -476,6 +476,7 @@ namespace WorldPackets
|
||||
class QuestGiverQueryQuest;
|
||||
class QuestGiverAcceptQuest;
|
||||
class QuestLogRemoveQuest;
|
||||
class QuestPushResult;
|
||||
}
|
||||
|
||||
namespace RaF
|
||||
@@ -1316,7 +1317,7 @@ class WorldSession
|
||||
void HandleQuestgiverCompleteQuest(WorldPackets::Quest::QuestGiverCompleteQuest& packet);
|
||||
void HandleQuestgiverQuestAutoLaunch(WorldPacket& recvPacket);
|
||||
void HandlePushQuestToParty(WorldPacket& recvPacket);
|
||||
void HandleQuestPushResult(WorldPacket& recvPacket);
|
||||
void HandleQuestPushResult(WorldPackets::Quest::QuestPushResult& packet);
|
||||
|
||||
void HandleChatMessageOpcode(WorldPackets::Chat::ChatMessage& chatMessage);
|
||||
void HandleChatMessageWhisperOpcode(WorldPackets::Chat::ChatMessageWhisper& chatMessageWhisper);
|
||||
|
||||
@@ -491,7 +491,7 @@ public:
|
||||
static bool HandleDebugSendQuestPartyMsgCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
uint32 msg = atoul(args);
|
||||
handler->GetSession()->GetPlayer()->SendPushToPartyResponse(handler->GetSession()->GetPlayer(), msg);
|
||||
handler->GetSession()->GetPlayer()->SendPushToPartyResponse(handler->GetSession()->GetPlayer(), static_cast<QuestPushReason>(msg));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user