New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Shared Tasks] Cross Zone Remove Fix #1740
Conversation
Why: The cross_zone_remove_task quest methods were not removing from shared_task_members database table and were not clearing shared task cache. This resulted in a situation where a character could not request other shared tasks. What: Shamelessly copied shared task logic from ClientTaskState::CancelTask into ClientTaskState::RemoveTaskByTaskID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, @hgtw should look it over though.
I’ll take a look at this one later |
This would work but looking at this method it seems to just mostly duplicate what Something like: if (m_active_task.task_id == task_id)
CancelTask(client, TASKSLOTTASK, TaskType::Task);
else if (m_active_shared_task.task_id == task_id)
CancelTask(client, TASKSLOTSHAREDTASK, TaskType::Shared);
else if (m_active_task_count > 0)
loop m_active_quests to find task_id, if found CancelTask(client, i, TaskType::Quest); |
Great idea. I will work on that. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hgtw had a suggestion around re-use
Instead of copying code from CancelTask into RemoveTaskByTaskID, it is better for code maintenance to simply call CancelTask from RemoveTaskByTaskID. This is cleaner. Note: I chose to be explicit with the remove_from_db parameter, despite true being the default. I tend to do this to protect from the default value changing in the future.
Removed unused variables. Distinguished log messages for Shared Tasks from regular Tasks.
Thanks for the extra work. I know it went a little beyond the scope of the original pr fix but getting this method refactored and cleaned up is appreciated |
Happy to help. Thank you for your feedback. It will help me in future refactors. |
Any reason this shouldn’t be merged? |
I think I was just waiting on @Akkadius to verify that I have addressed his concerns. |
@mmcgarvey sorry for the lag time on this one. Appreciate you following up on feedback |
Also appreciate your PR descriptions and the context you provide |
Why:
The cross_zone_remove_task quest methods were not removing from
shared_task_members database table and were not clearing shared task
cache. This resulted in a situation where a character could not
request other shared tasks.
What:
Shamelessly copied shared task logic from ClientTaskState::CancelTask
into ClientTaskState::RemoveTaskByTaskID