def wrongTurn(game_id, player_id): db.updatePlayerStatus(game_id, player_id, "failed") nextPlayer = db.getNextPlayer(game_id, player_id) if not nextPlayer: return db.updateGameStatus(game_id, "failed") return db.updatePlayerStatus(game_id, nextPlayer, "turn")
def correctTurn(game_id, player_id, newStep): db.updateGameStep(game_id, newStep) db.updatePlayerStatus(game_id, player_id, "ready") nextPlayer = db.getNextPlayer(game_id, player_id) return db.updatePlayerStatus(game_id, nextPlayer, "turn")