From f7c7f5646ec53f0bf9f61602cf7120290be937f8 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 8 Jun 2019 17:38:04 -0400 Subject: [PATCH] Rename PendSharedTask and update comment --- zone/client_packet.cpp | 2 +- zone/tasks.cpp | 11 +++++++---- zone/tasks.h | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 691c8f077..3143a196d 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1799,7 +1799,7 @@ void Client::Handle_OP_AcceptNewSharedTask(const EQApplicationPacket *app) auto *ant = (AcceptNewSharedTask_Struct*)app->pBuffer; if (ant->task_id > 0 && RuleB(TaskSystem, EnableTaskSystem) && taskstate) - taskstate->PendSharedTask(this, ant->task_id, ant->task_master_id); + taskstate->RequestSharedTask(this, ant->task_id, ant->task_master_id); } void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index ec831724a..4023998f4 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -3375,10 +3375,13 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor parse->EventNPC(EVENT_TASK_ACCEPTED, npc, c, buf.c_str(), 0); } -// This function will do a bunch of verification, then set up a pending state which will then send a request -// to world and send off requests to out of group zones to ask if they can join the task -// Once the we get all of the replies that pass, we will then assign the task -void ClientTaskState::PendSharedTask(Client *c, int TaskID, int NPCID, bool enforce_level_requirement) +/* + * This function is a proxy for OP_AccetNewSharedTask since it has to fire to + * world. We do a handful of checks on the leader, then build a packet with a + * list of all the members in our group/raid if applicable. The verification for + * the other members is done in world. + */ +void ClientTaskState::RequestSharedTask(Client *c, int TaskID, int NPCID, bool enforce_level_requirement) { if (!taskmanager || TaskID < 0 || TaskID >= MAXTASKS) { c->Message(13, "Task system not functioning, or TaskID %i out of range.", TaskID); diff --git a/zone/tasks.h b/zone/tasks.h index 63e6753ef..2bad493f1 100644 --- a/zone/tasks.h +++ b/zone/tasks.h @@ -180,7 +180,7 @@ public: bool HasSlotForTask(TaskInformation *task); // shared task related functions void AcceptNewSharedTask(Client *c, int TaskID, int NPCID, int id, int accepted_time, std::vector &members); - void PendSharedTask(Client *c, int TaskID, int NPCID, bool enforce_level_requirement = false); + void RequestSharedTask(Client *c, int TaskID, int NPCID, bool enforce_level_requirement = false); inline bool HasFreeTaskSlot() { return ActiveTask.TaskID == TASKSLOTEMPTY; }