From 6d0d3c07d091e52f18a330ee2d5e82cdc575190f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 10 Sep 2022 01:55:13 +0200 Subject: [PATCH] make new casino respect rehab award --- files/routes/casino.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/files/routes/casino.py b/files/routes/casino.py index ec298188a..9b6d4f769 100644 --- a/files/routes/casino.py +++ b/files/routes/casino.py @@ -13,12 +13,16 @@ from files.helpers.lottery import * @app.get("/casino") @auth_required def casino(v): + if v.rehab: return {"error": "You are under Rehab award effect!"} + participants = get_users_participating_in_lottery() return render_template("casino.html", v=v, participants=participants) @app.get("/casino/") @auth_required def casino_game_page(v, game): + if v.rehab: return {"error": "You are under Rehab award effect!"} + return render_template( f"casino/{game}_screen.html", v=v, @@ -30,6 +34,8 @@ def casino_game_page(v, game): @limiter.limit("3/second;30/minute;600/hour;12000/day") @auth_required def pull_slots(v): + if v.rehab: return {"error": "You are under Rehab award effect!"} + try: wager = int(request.values.get("wager")) except: @@ -55,6 +61,8 @@ def pull_slots(v): @limiter.limit("3/second;30/minute;600/hour;12000/day") @auth_required def get_player_blackjack_status(v): + if v.rehab: return {"error": "You are under Rehab award effect!"} + game, _, safe_state = get_active_game(v) if game: @@ -67,6 +75,8 @@ def get_player_blackjack_status(v): @limiter.limit("3/second;30/minute;600/hour;12000/day") @auth_required def player_took_blackjack_action(v): + if v.rehab: return {"error": "You are under Rehab award effect!"} + try: action = request.values.get("action") except: