This commit is contained in:
ryan
2026-01-18 16:22:43 -05:00
parent 96716d95b6
commit e431ba45e9
9 changed files with 235 additions and 5 deletions

View File

@@ -302,3 +302,25 @@ def seek_audio(game_id):
return jsonify({'message': f'Audio seeked to {position}s'}), 200
except Exception as e:
return jsonify({'error': str(e)}), 500
@bp.route('/game/<int:game_id>/advance-turn', methods=['POST'])
@require_auth
def advance_turn(game_id):
"""Advance to the next team's turn"""
game = Game.query.get_or_404(game_id)
try:
next_team = game_service.advance_turn(game, socketio)
if next_team:
return jsonify({
'message': 'Turn advanced',
'current_turn_team_id': next_team.id,
'current_turn_team_name': next_team.name
}), 200
else:
return jsonify({'error': 'No teams in game'}), 400
except Exception as e:
db.session.rollback()
return jsonify({'error': str(e)}), 500