forked from rDrama/rDrama
PCM: disable gambling; extend FEATURES['GAMBLING'].
parent
c6fb0da30b
commit
7ea61f423d
|
@ -338,6 +338,7 @@ if SITE == 'rdrama.net':
|
||||||
elif SITE == 'pcmemes.net':
|
elif SITE == 'pcmemes.net':
|
||||||
PIN_LIMIT = 10
|
PIN_LIMIT = 10
|
||||||
FEATURES['REPOST_DETECTION'] = False
|
FEATURES['REPOST_DETECTION'] = False
|
||||||
|
FEATURES['GAMBLING'] = False
|
||||||
POST_RATE_LIMIT = '1/second;4/minute;20/hour;100/day'
|
POST_RATE_LIMIT = '1/second;4/minute;20/hour;100/day'
|
||||||
|
|
||||||
HOLE_COST = 2000
|
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)"
|
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_TICKET_COST = 12
|
||||||
LOTTERY_SINK_RATE = -8
|
LOTTERY_SINK_RATE = -8
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,9 @@ def cron(every_5m, every_1h, every_1d, every_1mo):
|
||||||
g.db = db_session()
|
g.db = db_session()
|
||||||
|
|
||||||
if every_5m:
|
if every_5m:
|
||||||
lottery.check_if_end_lottery_task()
|
if FEATURES['GAMBLING']:
|
||||||
spin_roulette_wheel()
|
lottery.check_if_end_lottery_task()
|
||||||
|
spin_roulette_wheel()
|
||||||
offsitementions.offsite_mentions_task()
|
offsitementions.offsite_mentions_task()
|
||||||
if SITE == 'pcmemes.net':
|
if SITE == 'pcmemes.net':
|
||||||
route_static.live_cached()
|
route_static.live_cached()
|
||||||
|
|
|
@ -15,7 +15,9 @@ from files.helpers.lottery import *
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def casino(v):
|
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/rehab.html", v=v)
|
||||||
|
|
||||||
return render_template("casino.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")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def casino_game_page(v, game):
|
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)
|
return render_template("casino/rehab.html", v=v)
|
||||||
if game not in CASINO_GAME_KINDS:
|
elif game not in CASINO_GAME_KINDS:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
feed = json.dumps(get_game_feed(game))
|
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")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def casino_game_feed(v, game):
|
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
|
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)
|
abort(404)
|
||||||
|
|
||||||
feed = get_game_feed(game)
|
feed = get_game_feed(game)
|
||||||
|
@ -66,7 +72,9 @@ def casino_game_feed(v, game):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def lottershe(v):
|
def lottershe(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/rehab.html", v=v)
|
||||||
|
|
||||||
participants = get_users_participating_in_lottery()
|
participants = get_users_participating_in_lottery()
|
||||||
|
@ -77,7 +85,9 @@ def lottershe(v):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def pull_slots(v):
|
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
|
return {"error": "You are under Rehab award effect!"}, 400
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -106,7 +116,9 @@ def pull_slots(v):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_deal_to_player(v):
|
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
|
return {"error": "You are under Rehab award effect!"}, 400
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -125,7 +137,9 @@ def blackjack_deal_to_player(v):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_player_hit(v):
|
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
|
return {"error": "You are under Rehab award effect!"}, 400
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -140,7 +154,9 @@ def blackjack_player_hit(v):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_player_stay(v):
|
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
|
return {"error": "You are under Rehab award effect!"}, 400
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -155,7 +171,9 @@ def blackjack_player_stay(v):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_player_doubled_down(v):
|
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
|
return {"error": "You are under Rehab award effect!"}, 400
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -170,7 +188,9 @@ def blackjack_player_doubled_down(v):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_player_bought_insurance(v):
|
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
|
return {"error": "You are under Rehab award effect!"}, 400
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -185,7 +205,9 @@ def blackjack_player_bought_insurance(v):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def roulette_get_bets(v):
|
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
|
return {"error": "You are under Rehab award effect!"}, 400
|
||||||
|
|
||||||
bets = get_roulette_bets()
|
bets = get_roulette_bets()
|
||||||
|
@ -197,7 +219,9 @@ def roulette_get_bets(v):
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def roulette_player_placed_bet(v):
|
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
|
return {"error": "You are under Rehab award effect!"}, 400
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -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>
|
<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">
|
<a class="mobile-nav-icon d-md-none" href="/casino">
|
||||||
<i class="fas fa-cards align-middle text-gray-500 black"></i>
|
<i class="fas fa-cards align-middle text-gray-500 black"></i>
|
||||||
</a>
|
</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>
|
<a class="nav-link" href="/leaderboard" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Leaderboard"><i class="fas fa-trophy"></i></a>
|
||||||
</li>
|
</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">
|
<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>
|
<a class="nav-link" href="/casino" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Casino"><i class="fas fa-cards"></i></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue