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

Replace the LOOT_READY session lockout with a bucketed event handler #620

Merged
merged 3 commits into from
Aug 21, 2023

Conversation

rdw-software
Copy link
Member

Much cleaner, simpler, and more reliable. The timeout is still adjustable so nothing should have been lost.

This is required to handle bucketed events, as we can't differentiate in the callback handler to RegisterBucketEvent.

The do-end block is temporary, just to avoid an incomprehensible diff due to indentation changes.
While still somewhat questionable due to being based on a fixed timing (0.5sec), it appears to handle the sequence of LOOT_READY -> LOOT_OPENED -> LOOT_READY much better than manually managing the "session lock". That means we can delete the locking mechanism (yay) and still prevent duplicate attempts from being counted.
This was clearly an ill-conceived feature from the start (due to lack of experience on my part), only necessitated by the second LOOT_READY that Blizzard seemingly introduced after the loot window is opened.

Thanks to the bucketed sequence we can completely purge it and it still works, at least as long as events trigger within the same 0.5sec burst delay. Of course, this doesn't fix attempts being lost if players are looting too fast, but if that turns out to be a problem it's trivial to adjust the delay (or even make it configurable).
@rdw-software rdw-software changed the title Rework the LOOT_READY session lockout to use bucketed events Replace the LOOT_READY session lockout with a bucketed event handler Aug 21, 2023
@rdw-software rdw-software merged commit 6f9c75d into master Aug 21, 2023
7 checks passed
@rdw-software rdw-software deleted the 500-session-lock-refactor branch August 21, 2023 11:55
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.

Container items are no longer tracked reliably after the latest patch (?)
1 participant