Factor player balance check into IsBetValid and make min/max bets optional

This commit is contained in:
moneromooo 2015-01-22 18:26:29 +00:00
parent 6d1136b459
commit cf122d032b
3 changed files with 7 additions and 20 deletions

View file

@ -575,10 +575,6 @@ def Blackjack(link,cmd):
log_info("Dice: %s's bet refused: %s" % (identity, reason))
link.send("%s: %s" % (link.user.nick, reason))
return
enough, reason = IsPlayerBalanceAtLeast(link,total_units_wagered)
if not enough:
link.send("%s: %s" % (link.user.nick, reason))
return
try:
rolls, seed = GetNewShuffleSeed(link)

View file

@ -74,20 +74,6 @@ def Dice(link,cmd):
link.send("%s: %s" % (link.user.nick, reason))
return
try:
balance = redis_hget("balances",identity)
if balance == None:
balance = 0
balance=long(balance)
if units > balance:
log_error ('%s does not have enough balance' % identity)
link.send("You only have %s" % (AmountToString(balance)))
return
except Exception,e:
log_error ('failed to query balance')
link.send("Failed to query balance")
return
try:
rolls, roll = Roll(link)
except: