frankobjank / natac

Free & open source networked game implemented in Python, inspired by Klaus Teuber's Settlers of Catan for MacOS and Linux.
1 stars 0 forks source link

Can Open Two Clients For Same Player #23

Open frankobjank opened 3 months ago

frankobjank commented 3 months ago

I was able to launch 2 red player clients. The first one was broken and the second one seemed to work normally. There is probably some validation on the server side to check if a client is currently connected or not. Since the server does not delete a player when they disconnect, it was allowing a new client to play as red if the client had been closed. There should be a way that the server can tell if a certain player is still connected, maybe client could send the server a "closing" message when the socket is about to close. Could also involve a timeout since a crash can lead to a client closing without closing the socket. The crash issue can maybe be fixed with a try/except/finally clause that closes the socket at the end.