Closed Konstantin9658 closed 3 months ago
Sorry, I found my own mistake after I released this issue. The thing was that I didn’t do one important thing in order to update the game state
useEffect(() => {
game.load(board);
}, [board, game]);
And that's it, the game works as I expected
Good afternoon I ask for help in explaining how to adapt the game against another player. The connection occurs via a web socket, and I understand that after the first move (white), the second player still has a game state that is as if the first player never left. I thought that it would be enough to update the board for the second player and the game would switch the course itself, but it turned out not... It seems that it is enough to update the game state in the event, but I don’t understand how to do this in my case.
I miscalculated, but where...?