If your opponent takes too long to move, you should be able to claim victory by forfeit.
Forfeit Requirements:
Game must be accepted: require(gameAccepted, "Game not started");
Game isn't already over: require(!gameOver, "Game already over");
The move timeout has expired: require(block.timestamp > lastMoveAt + MOVE_TIMEOUT, "Timeout not reached");
Turn Validation:
Only the player whose turn it ISN'T can claim forfeit.
If it's X's turn, O can claim: if (xTurn) { require(msg.sender == playerO, ...); }
If it's O's turn, X can claim: else { require(msg.sender == playerX, ...); }
Awarding the Win:
Credit the caller: credits[msg.sender] += stake * 2;
End the game: gameOver = true; winner = msg.sender;
Create the claimForfeit() function with all checks.