PKR: Fix reading of player stacks

This commit is contained in:
Worros 2010-09-03 16:40:40 +08:00
parent 7038af303c
commit 2f5c4df1c5

View File

@ -125,15 +125,9 @@ class Pkr(HandHistoryConverter):
["ring", "hold", "pl"], ["ring", "hold", "pl"],
["ring", "hold", "fl"], ["ring", "hold", "fl"],
["ring", "stud", "fl"],
["ring", "draw", "fl"],
["tour", "hold", "nl"], ["tour", "hold", "nl"],
["tour", "hold", "pl"], ["tour", "hold", "pl"],
["tour", "hold", "fl"], ["tour", "hold", "fl"],
["tour", "stud", "fl"],
] ]
def determineGameType(self, handText): def determineGameType(self, handText):
@ -148,6 +142,8 @@ class Pkr(HandHistoryConverter):
mg = m.groupdict() mg = m.groupdict()
#print "DEBUG: %s" % mg #print "DEBUG: %s" % mg
info['type'] = 'ring'
if 'LIMIT' in mg: if 'LIMIT' in mg:
info['limitType'] = self.limits[mg['LIMIT']] info['limitType'] = self.limits[mg['LIMIT']]
if 'GAME' in mg: if 'GAME' in mg:
@ -159,11 +155,6 @@ class Pkr(HandHistoryConverter):
if 'CURRENCY' in mg: if 'CURRENCY' in mg:
info['currency'] = self.currencies[mg['CURRENCY']] info['currency'] = self.currencies[mg['CURRENCY']]
if 'TOURNO' in mg and mg['TOURNO'] is None:
info['type'] = 'ring'
else:
info['type'] = 'tour'
if info['limitType'] == 'fl' and info['bb'] is not None and info['type'] == 'ring' and info['base'] != 'stud': if info['limitType'] == 'fl' and info['bb'] is not None and info['type'] == 'ring' and info['base'] != 'stud':
try: try:
info['sb'] = self.Lim_Blinds[mg['BB']][0] info['sb'] = self.Lim_Blinds[mg['BB']][0]
@ -240,8 +231,16 @@ class Pkr(HandHistoryConverter):
def readPlayerStacks(self, hand): def readPlayerStacks(self, hand):
log.debug("readPlayerStacks") log.debug("readPlayerStacks")
m = self.re_PlayerInfo.finditer(hand.handText) m = self.re_PlayerInfo.finditer(hand.handText)
players = {} # Player Stacks are printed in the same format
# At the beginning and end of the hand history
# The hash is to cache the player names, and ignore
# The second round
for a in m: for a in m:
if players.has_key(a.group('PNAME')):
pass # Ignore
else:
hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), a.group('CASH')) hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), a.group('CASH'))
players[a.group('PNAME')] = True
def markStreets(self, hand): def markStreets(self, hand):
# PREFLOP = ** Dealing down cards ** # PREFLOP = ** Dealing down cards **