hwoodward / Remote-Card-Games

Program for playing card games online/remotely. Goal is to play a game of hand and foot with multiple groups in different locations.
MIT License
2 stars 1 forks source link

Disconnect bug #100

Closed hwoodward closed 4 years ago

hwoodward commented 4 years ago

Fixes issues with disconnect for issue #97

Specifically this fixes 2 problems. One was that we got an npe on disconnecting the last player because that was inherently the active player and it tried to calculate next turn despite having already set gameOver. The other was what I believe was crashing the game - when a player was denied a connection due to a game already being started it ran disconnect code and was unable to find that denied channel it was closing in the player list. That crashed everyone out. When anything, like a web browser or some other utility, pinged the public address of the server for a remote game it was treated like a client, denied connection because there was a game, and then everything crashed.

Was able to reproduce the crash.