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

Unhandled CHANGE_ENTITY due to missing card id #6

Closed
beheh opened this issue Jun 7, 2018 · 1 comment
Closed

Unhandled CHANGE_ENTITY due to missing card id #6

beheh opened this issue Jun 7, 2018 · 1 comment
Assignees
Labels

Comments

@beheh
Copy link
Contributor

beheh commented Jun 7, 2018

Looks like we're losing track of some card id. This seems to only affect Monster Hunter games where Toki, or the final boss Toki is in play.

https://sentry.io/hearthsim/hsreplaynet-lambdas/issues/537416952

@beheh beheh added the bug label Jun 7, 2018
@beheh beheh changed the title Toki Games result in unhandled CHANGE_ENTITY due to missing card id Unhandled CHANGE_ENTITY due to missing card id Jun 7, 2018
@jleclanche jleclanche self-assigned this Jun 7, 2018
@beheh beheh added this to the Sprint Bring It On! milestone Jun 7, 2018
@amw2104 amw2104 assigned jleclanche and unassigned jleclanche Jun 7, 2018
@HearthSim HearthSim deleted a comment from amw2104 Jun 8, 2018
@jleclanche
Copy link
Member

Here's what was happening:

GAME_RESET was added in Witchwood (Toki, monster hunt). This resets to an empty game state and was implemented in the previous version of the library.
If there are entities removed and re-created after the reset, these entities retain the same IDs. Now to prevent multiple entities with the same ID being added to the state tracker, I added safeguards in the previous version of python hearthstone, which check to ensure the entity doesn't already exist.

Now as of the latest patch, there are sometimes jumps in entity IDs, which prevented those safeguards from working. So I changed the entity tracking to be dict-based. That had been on the TODO for a while (ever since dicts were officially blessed as sorted). So we gain a bit of performance and sanity there, and the issue won't resurface. I also added a test for this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants