PCM: disable gambling; extend FEATURES['GAMBLING'].

remotes/1693176582716663532/tmp_refs/heads/watchparty
Snakes 2022-10-07 20:31:46 -04:00
parent c6fb0da30b
commit 7ea61f423d
Signed by: Snakes
GPG Key ID: E745A82778055C7E
4 changed files with 45 additions and 18 deletions

View File

@ -338,6 +338,7 @@ if SITE == 'rdrama.net':
elif SITE == 'pcmemes.net':
PIN_LIMIT = 10
FEATURES['REPOST_DETECTION'] = False
FEATURES['GAMBLING'] = False
POST_RATE_LIMIT = '1/second;4/minute;20/hour;100/day'
HOLE_COST = 2000
@ -356,6 +357,7 @@ elif SITE == 'pcmemes.net':
WELCOME_MSG = "Welcome to pcmemes.net! Don't forget to turn off the slur filter [here](/settings/content#slurreplacer)"
CASINO_ENABLED = False
LOTTERY_TICKET_COST = 12
LOTTERY_SINK_RATE = -8

View File

@ -28,8 +28,9 @@ def cron(every_5m, every_1h, every_1d, every_1mo):
g.db = db_session()
if every_5m:
lottery.check_if_end_lottery_task()
spin_roulette_wheel()
if FEATURES['GAMBLING']:
lottery.check_if_end_lottery_task()
spin_roulette_wheel()
offsitementions.offsite_mentions_task()
if SITE == 'pcmemes.net':
route_static.live_cached()

View File

@ -15,7 +15,9 @@ from files.helpers.lottery import *
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def casino(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return render_template("casino/rehab.html", v=v)
return render_template("casino.html", v=v)
@ -25,9 +27,11 @@ def casino(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def casino_game_page(v, game):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return render_template("casino/rehab.html", v=v)
if game not in CASINO_GAME_KINDS:
elif game not in CASINO_GAME_KINDS:
abort(404)
feed = json.dumps(get_game_feed(game))
@ -52,9 +56,11 @@ def casino_game_page(v, game):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def casino_game_feed(v, game):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
if game not in CASINO_GAME_KINDS:
elif game not in CASINO_GAME_KINDS:
abort(404)
feed = get_game_feed(game)
@ -66,7 +72,9 @@ def casino_game_feed(v, game):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def lottershe(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return render_template("casino/rehab.html", v=v)
participants = get_users_participating_in_lottery()
@ -77,7 +85,9 @@ def lottershe(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def pull_slots(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
try:
@ -106,7 +116,9 @@ def pull_slots(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def blackjack_deal_to_player(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
try:
@ -125,7 +137,9 @@ def blackjack_deal_to_player(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def blackjack_player_hit(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
try:
@ -140,7 +154,9 @@ def blackjack_player_hit(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def blackjack_player_stay(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
try:
@ -155,7 +171,9 @@ def blackjack_player_stay(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def blackjack_player_doubled_down(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
try:
@ -170,7 +188,9 @@ def blackjack_player_doubled_down(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def blackjack_player_bought_insurance(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
try:
@ -185,7 +205,9 @@ def blackjack_player_bought_insurance(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def roulette_get_bets(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
bets = get_roulette_bets()
@ -197,7 +219,9 @@ def roulette_get_bets(v):
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def roulette_player_placed_bet(v):
if v.rehab:
if not FEATURES['GAMBLING']:
abort(404)
elif v.rehab:
return {"error": "You are under Rehab award effect!"}, 400
try:

View File

@ -128,7 +128,7 @@
<a class="mobile-nav-icon d-md-none" href="/random_user"><i class="fas fa-music align-middle text-gray-500 black"></i></a>
{% if v and CASINO_ENABLED %}
{% if v and CASINO_ENABLED and FEATURES['GAMBLING'] %}
<a class="mobile-nav-icon d-md-none" href="/casino">
<i class="fas fa-cards align-middle text-gray-500 black"></i>
</a>
@ -194,7 +194,7 @@
<a class="nav-link" href="/leaderboard" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Leaderboard"><i class="fas fa-trophy"></i></a>
</li>
{% if CASINO_ENABLED %}
{% if CASINO_ENABLED and FEATURES['GAMBLING'] %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/casino" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Casino"><i class="fas fa-cards"></i></a>
</li>