From 687d10960a02b0aee50d0506aaf12d6191f8adb2 Mon Sep 17 00:00:00 2001 From: JJ <3617814+joligario@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:32:45 -0400 Subject: [PATCH] [Logs] Fix output for tasks in logs (#4907) --- common/shared_tasks.h | 2 +- world/shared_task_manager.cpp | 8 ++++---- world/shared_task_world_messaging.cpp | 6 +++--- zone/shared_task_zone_messaging.cpp | 2 +- zone/task_client_state.cpp | 8 ++++---- zone/task_client_state.h | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/common/shared_tasks.h b/common/shared_tasks.h index b9ee0c065..b12053a4c 100644 --- a/common/shared_tasks.h +++ b/common/shared_tasks.h @@ -48,7 +48,7 @@ enum class SharedTaskRequestGroupType { struct ServerSharedTaskRequest_Struct { uint32 requested_character_id; uint32 requested_task_id; - uint32 requested_npc_type_id; // original task logic passthrough + uint32 requested_npc_entity_id; // original task logic passthrough uint32 accept_time; }; diff --git a/world/shared_task_manager.cpp b/world/shared_task_manager.cpp index f63ab0ac7..61a280f55 100644 --- a/world/shared_task_manager.cpp +++ b/world/shared_task_manager.cpp @@ -677,10 +677,10 @@ void SharedTaskManager::SendAcceptNewSharedTaskPacket( ); auto d = reinterpret_cast(p->pBuffer); - d->requested_character_id = character_id; - d->requested_task_id = task_id; - d->requested_npc_type_id = npc_context_id; - d->accept_time = accept_time; + d->requested_character_id = character_id; + d->requested_task_id = task_id; + d->requested_npc_entity_id = npc_context_id; + d->accept_time = accept_time; // get requested character zone server ClientListEntry *cle = client_list.FindCLEByCharacterID(character_id); diff --git a/world/shared_task_world_messaging.cpp b/world/shared_task_world_messaging.cpp index e6271a458..0256263ce 100644 --- a/world/shared_task_world_messaging.cpp +++ b/world/shared_task_world_messaging.cpp @@ -24,16 +24,16 @@ void SharedTaskWorldMessaging::HandleZoneMessage(ServerPacket *pack) case ServerOP_SharedTaskRequest: { auto *r = (ServerSharedTaskRequest_Struct *) pack->pBuffer; LogTasksDetail( - "[ServerOP_SharedTaskRequest] Received request from character [{}] task_id [{}] npc_type_id [{}]", + "[ServerOP_SharedTaskRequest] Received request from character [{}] task_id [{}] npc_entity_id [{}]", r->requested_character_id, r->requested_task_id, - r->requested_npc_type_id + r->requested_npc_entity_id ); shared_task_manager.AttemptSharedTaskCreation( r->requested_task_id, r->requested_character_id, - r->requested_npc_type_id + r->requested_npc_entity_id ); break; diff --git a/zone/shared_task_zone_messaging.cpp b/zone/shared_task_zone_messaging.cpp index 8009dc944..eac3a783a 100644 --- a/zone/shared_task_zone_messaging.cpp +++ b/zone/shared_task_zone_messaging.cpp @@ -20,7 +20,7 @@ void SharedTaskZoneMessaging::HandleWorldMessage(ServerPacket *pack) ->AcceptNewTask( c, (int) p->requested_task_id, - (int) p->requested_npc_type_id, + (int) p->requested_npc_entity_id, p->accept_time ); c->LoadClientTaskState(); diff --git a/zone/task_client_state.cpp b/zone/task_client_state.cpp index 1509db8af..1bd633ddf 100644 --- a/zone/task_client_state.cpp +++ b/zone/task_client_state.cpp @@ -1968,7 +1968,7 @@ void ClientTaskState::RemoveTaskByTaskID(Client *client, uint32 task_id) void ClientTaskState::AcceptNewTask( Client *client, int task_id, - int npc_type_id, + int npc_entity_id, time_t accept_time, bool enforce_level_requirement ) @@ -2001,7 +2001,7 @@ void ClientTaskState::AcceptNewTask( // fill r->requested_character_id = client->CharacterID(); r->requested_task_id = task_id; - r->requested_npc_type_id = npc_type_id; + r->requested_npc_entity_id = npc_entity_id; // send worldserver.SendPacket(pack); @@ -2190,11 +2190,11 @@ void ClientTaskState::AcceptNewTask( task_manager->SaveClientState(client, this); - NPC *npc = entity_list.GetID(npc_type_id)->CastToNPC(); + NPC *npc = entity_list.GetNPCByID(npc_entity_id); if (npc) { if (player_event_logs.IsEventEnabled(PlayerEvent::TASK_ACCEPT)) { auto e = PlayerEvent::TaskAcceptEvent{ - .npc_id = static_cast(npc_type_id), + .npc_id = npc->GetNPCTypeID(), .npc_name = npc->GetCleanName(), .task_id = static_cast(task_id), .task_name = task_manager->GetTaskName(static_cast(task_id)), diff --git a/zone/task_client_state.h b/zone/task_client_state.h index c767070d0..c43329734 100644 --- a/zone/task_client_state.h +++ b/zone/task_client_state.h @@ -42,7 +42,7 @@ public: int GetTaskActivityDoneCount(TaskType task_type, int index, int activity_id); int GetTaskActivityDoneCountFromTaskID(int task_id, int activity_id); int GetTaskStartTime(TaskType task_type, int index); - void AcceptNewTask(Client *client, int task_id, int npc_type_id, time_t accept_time, bool enforce_level_requirement = false); + void AcceptNewTask(Client *client, int task_id, int npc_entity_id, time_t accept_time, bool enforce_level_requirement = false); void FailTask(Client *client, int task_id); int TaskTimeLeft(int task_id); bool IsTaskCompleted(int task_id, Client *c = nullptr);