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

Sometimes when last user disconnects (maybe while turn is changing?), server crashes #29

Closed
LearningNerd opened this issue Jul 3, 2017 · 1 comment

Comments

@LearningNerd
Copy link
Member

Undefined variable error from line 300 (in the getTurnData() method) when trying to access the name of a player who just disconnected.

This bug seems like it might be hard to replicate, but my best guess is that it's a timing issue with the turnChange and disconnect events.

Idea for a solution: Just add another check to the offending function so that it only runs if the variable it's accessing is not null.

@LearningNerd
Copy link
Member Author

This was also resolved somewhere within pull request #32 when closing issue #16! (It's because turnIndex wasn't being updated when players disconnected, so sometimes it pointed to a nonexistent slot in the players array instead of pointing to the current player!)

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

No branches or pull requests

1 participant