Closed ashelkovnykov closed 1 year ago
Another potential idea: moves implemented by threads?
@belisarius222 had some strong thoughts regarding the philosophical purity of moves.
Once you have made a valid move (valid meaning it passes your own agent's move verification code), it is irrelevant for what reason move propagation fails: network latency, opponent ship down, malicious opponent rejecting valid moves, etc. Your %chess
agent can surface whatever information/warnings it likes to you, but the move may not be undone. The fact that there is some error with communicating the move does not change that it is the move you chose to make while under the impression that no communication issues are forthcoming, and that your opponent is an honest party.
Moves are currently handled as updates along a subscription. They should instead be handled as pokes. It's possible for a move to be rejected, meaning that it's possible for the move message to be nacked. Updates cannot be nacked, and therefore allow the game states to diverge. Making the reception of an ack to a move a condition for performing the move locally keeps both players's game states consistent.