code100x / chess

A multiplayer chess platform
https://chess.100xdevs.com/
1.62k stars 584 forks source link

Rejoin a user in IN_PROGRESS match don't let them create new one! And Fix Game not getting removed #332

Open asutosh-147 opened 6 months ago

asutosh-147 commented 6 months ago

if a user has any match in progress and he tries to create a new random match then don't let him create a new random match instead rejoin him with that inprogress match.

this will ensure that there exists no two matches in games array(inside gameManager class) in which same player is playing simultaneously more than one matches (i.e. no 2 matches in games[ ] will have any common whitePlayerId or blackPlayerId)