Closed scottven closed 8 years ago
But can't it be obtained by moveno%2 ? Edit: or just flipping current state?
Yes, I can parse it out of the PTN, but it would be nice to have a cross-check since this is asynchronous The remote player could be asking to undo their last turn, but the message might not arrive until after I've already sent my next move. For now, incoming commands queue up while waiting for the AI move, so that makes the race easier to lose.
Even if I put a turn no. or player name in the msg, if you send your move without undoing, the board state is messed up anyway and this wouldn't fix anything. Maybe after the AI moves, you could process the server commands and only send the AI move if there was no Undo...
With the current scheduling, it'll actually send the new move, then process the undo request. Does the server drop the undo request when it see a new move from the non-requesting player?
Yes, it drops the request if either of the players make a move.
OK. I think that means I'm better off just ignore undo requests for now until I get my AI calls into my main scheduling loop.
Can you have the 'Undo' message include who's turn it is, similar to the GameList lines? It'll make restoring the state easier for the AI.