Send played move to both players.

This commit is contained in:
Marco 2022-12-18 23:13:25 +01:00
parent bfc9d247be
commit f303a572cc

View File

@ -86,7 +86,12 @@ func (game *chessGame) handle() {
gameState = WhiteToMove gameState = WhiteToMove
} }
err := WriteMessageToPlayer(&game.currentTurnPlayer, receivedMessage, messageType) err := WriteMessageToPlayer(&game.players[0], receivedMessage, messageType)
if err != nil {
log.Println("Error during message writing:", err)
break
}
err = WriteMessageToPlayer(&game.players[1], receivedMessage, messageType)
if err != nil { if err != nil {
log.Println("Error during message writing:", err) log.Println("Error during message writing:", err)
break break