keldaanCommunity / pokemonAutoChess

Pokemon Auto Chess Game. Made by fans for fans. Open source, non profit. All rights to the Pokemon Company.
https://pokemon-auto-chess.com/
GNU General Public License v3.0
1.17k stars 362 forks source link

fix autoready bug #2457

Closed sylvainpolletvillard closed 5 days ago

sylvainpolletvillard commented 6 days ago

The bug came from a race condition between UserMetadata.findOne db call to init player info vs client loading the prep room and sending the toggle ready command

Waiting for user to be added to state.users before sending the ready message fixes it