cleanupBlackJack

This commit is contained in:
SpudGunMan
2025-10-19 13:23:40 -07:00
parent a233d8c7b3
commit b257625a45
2 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -718,8 +718,9 @@ def handleBlackJack(message, nodeID, deviceID):
# Create new player if not found
if not player and nodeID != 0:
logger.debug(f"System: BlackJack: New Player {nodeID}")
jackTracker.append({'nodeID': nodeID, 'cmd': 'new', 'last_played': time.time()})
msg += "Welcome to 🃏BlackJack!🃏\n"
msg += "Welcome to 🃏BlackJack!♣️♦️\n"
# Show high score if available
highScore = loadHSJack()
if highScore and highScore.get('nodeID', 0) != 0:
+8 -4
View File
@@ -266,11 +266,15 @@ def playBlackJack(nodeID, message):
next_card = jackTracker[i]['next_card']
if last_cmd is None:
if p_chips.total < 1:
p_chips.total = jack_starting_cash
else:
pass
# create new player if not in tracker
logger.debug(f"System: BlackJack: New Player {nodeID}")
jackTracker.append({'nodeID': nodeID, 'cmd': 'new', 'last_played': time.time(), 'cash': jack_starting_cash,\
'bet': 0, 'gameStats': {'p_win': p_win, 'd_win': d_win, 'draw': draw}, 'p_cards':p_cards, 'd_cards':d_cards, 'p_hand':p_hand.cards, 'd_hand':d_hand.cards, 'next_card':next_card})
return f"Welcome to ♠️♥️BlackJack♣️♦️ you have {p_chips.total} chips. Whats your bet?"
#logger.debug(f"System: BlackJack: New Player {nodeID}")
#jackTracker.append({'nodeID': nodeID, 'cmd': 'new', 'last_played': time.time(), 'cash': jack_starting_cash,\
## 'bet': 0, 'gameStats': {'p_win': p_win, 'd_win': d_win, 'draw': draw}, 'p_cards':p_cards, 'd_cards':d_cards, 'p_hand':p_hand.cards, 'd_hand':d_hand.cards, 'next_card':next_card})
return f"You have {p_chips.total} chips. Whats your bet?"
if getLastCmdJack(nodeID) == "new":
# Place Bet