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

Prune duplicate commands #7640

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NBKelly
Copy link
Collaborator

@NBKelly NBKelly commented Aug 12, 2024

Essentially, if some packets are slowed down in transit, or there's a holdup, and we end up clicking draw again, sometimes after 3-4 seconds we suddenly draw 2 cards. What this does it asserts, when receiving a game action, that we haven't made another game action within the last 30ms. That should solve most of these issues (where the issue is the packet making it to the server, rather than the packet making it back), and should also solve double-clicking mice.

We can do most of the work to fix lag, but there will always be random path issues for random users at random times, or users with spotty connections, so this will always be relevant.

From my testing, this works fine, but right now it makes every single unit test in the game fail, so there's clearly something significant I need to change 😂

Closes #5213

@NoahTheDuke
Copy link
Collaborator

This is debouncing, which should probably be done on the front end. We're supposed to be checking action ids with each other to avoid some of this too. Maybe we need an ":ack" sent from the server to the frontend to let the frontend send more messages?

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.

Lag when clicking the "draw card" button can lead to ruined games
2 participants