forked from rDrama/rDrama
restore blackjack
parent
9ff3f9eea6
commit
5797132548
|
@ -60,7 +60,7 @@ class Service(Enum):
|
||||||
POST_RATELIMIT = '1/second;10/hour;20/day'
|
POST_RATELIMIT = '1/second;10/hour;20/day'
|
||||||
DEFAULT_RATELIMIT_SLOWER = "1/second;30/minute;200/hour;1000/day"
|
DEFAULT_RATELIMIT_SLOWER = "1/second;30/minute;200/hour;1000/day"
|
||||||
DEFAULT_RATELIMIT = "3/second;30/minute;200/hour;1000/day"
|
DEFAULT_RATELIMIT = "3/second;30/minute;200/hour;1000/day"
|
||||||
CASINO_RATELIMIT = "5/second;100/minute;2000/hour;12000/day"
|
CASINO_RATELIMIT = "1/second;100/minute;2000/hour;12000/day"
|
||||||
|
|
||||||
PUSH_NOTIF_LIMIT = 1000
|
PUSH_NOTIF_LIMIT = 1000
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ def casino_game_page(v:User, game):
|
||||||
|
|
||||||
game_state = ''
|
game_state = ''
|
||||||
if game == 'blackjack':
|
if game == 'blackjack':
|
||||||
abort(403, "Disabled temporarily to fix exploit!")
|
|
||||||
if get_active_twentyone_game(v):
|
if get_active_twentyone_game(v):
|
||||||
game_state = json.dumps(get_active_twentyone_game_state(v))
|
game_state = json.dumps(get_active_twentyone_game_state(v))
|
||||||
|
|
||||||
|
@ -111,89 +110,89 @@ def pull_slots(v:User):
|
||||||
abort(400, f"Wager must be 5 {currency} or more")
|
abort(400, f"Wager must be 5 {currency} or more")
|
||||||
|
|
||||||
|
|
||||||
# # 21
|
# 21
|
||||||
# @app.post("/casino/twentyone/deal")
|
@app.post("/casino/twentyone/deal")
|
||||||
# @limiter.limit(CASINO_RATELIMIT)
|
@limiter.limit(CASINO_RATELIMIT)
|
||||||
# @limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
@limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
||||||
# @auth_required
|
@auth_required
|
||||||
# def blackjack_deal_to_player(v:User):
|
def blackjack_deal_to_player(v:User):
|
||||||
# if v.rehab:
|
if v.rehab:
|
||||||
# abort(403, "You are under Rehab award effect!")
|
abort(403, "You are under Rehab award effect!")
|
||||||
|
|
||||||
# try:
|
try:
|
||||||
# wager = int(request.values.get("wager"))
|
wager = int(request.values.get("wager"))
|
||||||
# currency = request.values.get("currency")
|
currency = request.values.get("currency")
|
||||||
# create_new_game(v, wager, currency)
|
create_new_game(v, wager, currency)
|
||||||
# state = dispatch_action(v, BlackjackAction.DEAL)
|
state = dispatch_action(v, BlackjackAction.DEAL)
|
||||||
# feed = get_game_feed('blackjack', g.db)
|
feed = get_game_feed('blackjack', g.db)
|
||||||
|
|
||||||
# return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||||
# except Exception as e:
|
except Exception as e:
|
||||||
# abort(400, str(e))
|
abort(400, str(e))
|
||||||
|
|
||||||
|
|
||||||
# @app.post("/casino/twentyone/hit")
|
@app.post("/casino/twentyone/hit")
|
||||||
# @limiter.limit(CASINO_RATELIMIT)
|
@limiter.limit(CASINO_RATELIMIT)
|
||||||
# @limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
@limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
||||||
# @auth_required
|
@auth_required
|
||||||
# def blackjack_player_hit(v:User):
|
def blackjack_player_hit(v:User):
|
||||||
# if v.rehab:
|
if v.rehab:
|
||||||
# abort(403, "You are under Rehab award effect!")
|
abort(403, "You are under Rehab award effect!")
|
||||||
|
|
||||||
# try:
|
try:
|
||||||
# state = dispatch_action(v, BlackjackAction.HIT)
|
state = dispatch_action(v, BlackjackAction.HIT)
|
||||||
# feed = get_game_feed('blackjack', g.db)
|
feed = get_game_feed('blackjack', g.db)
|
||||||
# return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||||
# except:
|
except:
|
||||||
# abort(400, "Unable to hit!")
|
abort(400, "Unable to hit!")
|
||||||
|
|
||||||
|
|
||||||
# @app.post("/casino/twentyone/stay")
|
@app.post("/casino/twentyone/stay")
|
||||||
# @limiter.limit(CASINO_RATELIMIT)
|
@limiter.limit(CASINO_RATELIMIT)
|
||||||
# @limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
@limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
||||||
# @auth_required
|
@auth_required
|
||||||
# def blackjack_player_stay(v:User):
|
def blackjack_player_stay(v:User):
|
||||||
# if v.rehab:
|
if v.rehab:
|
||||||
# abort(403, "You are under Rehab award effect!")
|
abort(403, "You are under Rehab award effect!")
|
||||||
|
|
||||||
# try:
|
try:
|
||||||
# state = dispatch_action(v, BlackjackAction.STAY)
|
state = dispatch_action(v, BlackjackAction.STAY)
|
||||||
# feed = get_game_feed('blackjack', g.db)
|
feed = get_game_feed('blackjack', g.db)
|
||||||
# return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||||
# except:
|
except:
|
||||||
# abort(400, "Unable to stay!")
|
abort(400, "Unable to stay!")
|
||||||
|
|
||||||
|
|
||||||
# @app.post("/casino/twentyone/double-down")
|
@app.post("/casino/twentyone/double-down")
|
||||||
# @limiter.limit(CASINO_RATELIMIT)
|
@limiter.limit(CASINO_RATELIMIT)
|
||||||
# @limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
@limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
||||||
# @auth_required
|
@auth_required
|
||||||
# def blackjack_player_doubled_down(v:User):
|
def blackjack_player_doubled_down(v:User):
|
||||||
# if v.rehab:
|
if v.rehab:
|
||||||
# abort(403, "You are under Rehab award effect!")
|
abort(403, "You are under Rehab award effect!")
|
||||||
|
|
||||||
# try:
|
try:
|
||||||
# state = dispatch_action(v, BlackjackAction.DOUBLE_DOWN)
|
state = dispatch_action(v, BlackjackAction.DOUBLE_DOWN)
|
||||||
# feed = get_game_feed('blackjack', g.db)
|
feed = get_game_feed('blackjack', g.db)
|
||||||
# return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||||
# except:
|
except:
|
||||||
# abort(400, "Unable to double down!")
|
abort(400, "Unable to double down!")
|
||||||
|
|
||||||
|
|
||||||
# @app.post("/casino/twentyone/buy-insurance")
|
@app.post("/casino/twentyone/buy-insurance")
|
||||||
# @limiter.limit(CASINO_RATELIMIT)
|
@limiter.limit(CASINO_RATELIMIT)
|
||||||
# @limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
@limiter.limit(CASINO_RATELIMIT, key_func=get_ID)
|
||||||
# @auth_required
|
@auth_required
|
||||||
# def blackjack_player_bought_insurance(v:User):
|
def blackjack_player_bought_insurance(v:User):
|
||||||
# if v.rehab:
|
if v.rehab:
|
||||||
# abort(403, "You are under Rehab award effect!")
|
abort(403, "You are under Rehab award effect!")
|
||||||
|
|
||||||
# try:
|
try:
|
||||||
# state = dispatch_action(v, BlackjackAction.BUY_INSURANCE)
|
state = dispatch_action(v, BlackjackAction.BUY_INSURANCE)
|
||||||
# feed = get_game_feed('blackjack', g.db)
|
feed = get_game_feed('blackjack', g.db)
|
||||||
# return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
return {"success": True, "state": state, "feed": feed, "gambler": {"coins": v.coins, "marseybux": v.marseybux}}
|
||||||
# except:
|
except:
|
||||||
# abort(403, "Unable to buy insurance!")
|
abort(403, "Unable to buy insurance!")
|
||||||
|
|
||||||
# Roulette
|
# Roulette
|
||||||
@app.get("/casino/roulette/bets")
|
@app.get("/casino/roulette/bets")
|
||||||
|
|
Loading…
Reference in New Issue