[Shared Tasks] Cleanup shared task request and remove (#2341)

Functionally nothing should change in this patch. This refactors a lot
of formatting and code duplication in requests and member removals.

The long SharedTaskMessage namespace and its constants were contributing
to a lot of formatting that was difficult to read. These were shortened
since they're not all shared task specific anyway (though they should
probably just be moved to string_ids.h with other eqstrs now)

Shared task requests were refactored a little to remove an unnecessary
function that filled potential members. The separate functions used for
/taskquit and /taskremove were also combined into a single function to
remove a member while preserving live message differences.
This commit is contained in:
hg
2022-07-30 21:36:04 -04:00
committed by GitHub
parent 8a962e09f6
commit d243cbf8a3
12 changed files with 220 additions and 419 deletions
+3 -3
View File
@@ -53,11 +53,11 @@ void SharedTaskZoneMessaging::HandleWorldMessage(ServerPacket *pack)
break;
}
case ServerOP_SharedTaskAttemptRemove: {
auto p = reinterpret_cast<ServerSharedTaskAttemptRemove_Struct *>(pack->pBuffer);
case ServerOP_SharedTaskQuit: {
auto p = reinterpret_cast<ServerSharedTaskQuit_Struct *>(pack->pBuffer);
auto c = entity_list.GetClientByCharID(p->requested_character_id);
if (c) {
LogTasks("[ServerOP_SharedTaskAttemptRemove] We're back in zone and I found [{}]", c->GetCleanName());
LogTasks("[ServerOP_SharedTaskQuit] We're back in zone and I found [{}]", c->GetCleanName());
c->m_requested_shared_task_removal = true;
c->GetTaskState()->CancelTask(