mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-28 20:07:56 +00:00
[Tasks] Add task accept packet validation (#2354)
This makes it so clients can only accept tasks that have been offered
This commit is contained in:
+14
-3
@@ -1835,7 +1835,13 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app)
|
||||
AcceptNewTask_Struct *ant = (AcceptNewTask_Struct*)app->pBuffer;
|
||||
|
||||
if (ant->task_id > 0 && RuleB(TaskSystem, EnableTaskSystem) && task_state)
|
||||
task_state->AcceptNewTask(this, ant->task_id, ant->task_master_id, std::time(nullptr));
|
||||
{
|
||||
if (task_state->CanAcceptNewTask(this, ant->task_id, ant->task_master_id))
|
||||
{
|
||||
task_state->AcceptNewTask(this, ant->task_id, ant->task_master_id, std::time(nullptr));
|
||||
}
|
||||
task_state->ClearLastOffers();
|
||||
}
|
||||
}
|
||||
|
||||
void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app)
|
||||
@@ -15552,8 +15558,13 @@ void Client::Handle_OP_SharedTaskAccept(const EQApplicationPacket* app)
|
||||
buf->task_id
|
||||
);
|
||||
|
||||
if (buf->task_id > 0 && RuleB(TaskSystem, EnableTaskSystem) && task_state) {
|
||||
task_state->AcceptNewTask(this, buf->task_id, buf->npc_entity_id, std::time(nullptr));
|
||||
if (buf->task_id > 0 && RuleB(TaskSystem, EnableTaskSystem) && task_state)
|
||||
{
|
||||
if (task_state->CanAcceptNewTask(this, buf->task_id, buf->npc_entity_id))
|
||||
{
|
||||
task_state->AcceptNewTask(this, buf->task_id, buf->npc_entity_id, std::time(nullptr));
|
||||
}
|
||||
task_state->ClearLastOffers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user