Skip to content
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

[Tasks] Avoid removing client tasks from memory on load #4052

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

hgtw
Copy link
Contributor

@hgtw hgtw commented Feb 10, 2024

If a task was deleted or had new elements added to it without updating character states to match changes, client state for the task was not loaded into memory and a "contact a GM" warning was sent to the client.

This caused an issue if a client later accepted a new task because it could be placed in the same client state slot as a non-loaded task. The table does not have constraints so this was also inserted into the db.

The next time client task state was reloaded after zoning, the new task would not be loaded since it occupied a used slot, even though that used slot was also not being loaded. The client could not remove or reacquire the original task without GM intervention and an entry was left in the db for the new task.

This makes the following changes to client task state loading:

  • If a task id no longer exists it is deleted from client state tables instead of only being removed from memory.

  • If a task occupies the same client state slot as another task, it is deleted from client state tables instead of being ignored.

  • If new elements have been added to a task, client state will keep the task in memory. The new activity states will be inserted into the db when necessary for updates (may not be immediate).

These changes also fix two smaller bugs as a consequence:

  • If a character was at the 20 quest limit the last quest wasn't being processed for activity count changes. The task would continue to show to clients but any added new elements couldn't be completed.

  • Deleted tasks that occupied slot 0 in client state would fallback to loading it as a solo task of type 0. This prevented a client's real solo task from being loaded if the deleted task was processed first.

Note clients may receive or lose credit for completed elements if new ones are added in the middle of tasks. Server ops will still need to update character state tables manually on task changes to prevent this.

If a task was deleted or had new elements added to it without updating
character states to match changes, client state for the task was not
loaded into memory and a "contact a GM" warning was sent to the client.

This caused an issue if a client later accepted a new task because it
could be placed in the same client state slot as a non-loaded task. The
table does not have constraints so this was also inserted into the db.

The next time client task state was reloaded after zoning, the new task
would not be loaded since it occupied a used slot, even though that used
slot was also not being loaded. The client could not remove or reacquire
the original task without GM intervention and an entry was left in the
db for the new task.

This makes the following changes to client task state loading:

 - If a task id no longer exists it is deleted from client state tables
   instead of only being removed from memory.

 - If a task occupies the same client state slot as another task, it is
   deleted from client state tables instead of being ignored.

 - If new elements have been added to a task, client state will keep the
   task in memory. The new activity states will be inserted into the db
   when necessary for updates (may not be immediate).

These changes also fix two smaller bugs as a consequence:

 - If a character was at the 20 quest limit the last quest wasn't being
   processed for activity count changes. The task would continue to show
   to clients but any added new elements couldn't be completed.

 - Deleted tasks that occupied slot 0 in client state would fallback to
   loading it as a solo task of type 0. This prevented a client's real
   solo task from being loaded if the deleted task was processed first.

Note clients may receive or lose credit for completed elements if new
ones are added in the middle of tasks. Server ops will still need to
update character state tables manually on task changes to prevent this.
@Kinglykrab Kinglykrab changed the title Avoid removing client tasks from memory on load [Tasks] Avoid removing client tasks from memory on load Feb 10, 2024
@Akkadius Akkadius merged commit 75539b4 into EQEmu:master Feb 10, 2024
1 check passed
@Akkadius Akkadius mentioned this pull request Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants