Added the column 'showed' to handsplayers which flags whether or not a player showed his or her hand. If false and 'sawSD' is true then they mucked. If true and 'sawSD' is false, then they showed outside of a showdown (site dependent). Also fixed up readShownCards in FTP's hhc so it recorded mucked and showed correctly.

This commit is contained in:
Chaz Littlejohn 2011-04-05 02:41:53 +00:00
parent 5f9d402701
commit d7ed15bcfe
5 changed files with 21 additions and 8 deletions

View File

@ -73,7 +73,7 @@ except ImportError:
use_numpy = False
DB_VERSION = 154
DB_VERSION = 155
# Variance created as sqlite has a bunch of undefined aggregate functions.
@ -1963,6 +1963,7 @@ class Database:
pdata[p]['street3Seen'],
pdata[p]['street4Seen'],
pdata[p]['sawShowdown'],
pdata[p]['showed'],
pdata[p]['wonAtSD'],
pdata[p]['street0Aggr'],
pdata[p]['street1Aggr'],

View File

@ -43,6 +43,7 @@ class DerivedStats():
init['street4Aggr'] = False
init['wonWhenSeenStreet1'] = 0.0
init['sawShowdown'] = False
init['showed'] = False
init['wonAtSD'] = 0.0
init['startCards'] = 0
init['position'] = 2
@ -187,6 +188,8 @@ class DerivedStats():
self.handsplayers[player[1]]['tourneysPlayersIds'] = hand.tourneysPlayersIds[player[1]]
else:
self.handsplayers[player[1]]['tourneysPlayersIds'] = None
if player[1] in hand.shown:
self.handsplayers[player[1]]['showed'] = True
#### seen now processed in playersAtStreetX()
# XXX: enumerate(list, start=x) is python 2.6 syntax; 'start'

View File

@ -170,7 +170,7 @@ class Fulltilt(HandHistoryConverter):
self.re_ShowdownAction = re.compile(r"^%s shows \[(?P<CARDS>.*)\]" % player_re, re.MULTILINE)
self.re_CollectPot = re.compile(r"^Seat (?P<SEAT>[0-9]+): %(PLAYERS)s (\(button\) |\(small blind\) |\(big blind\) )?(collected|showed \[.*\] and won) \([%(LS)s]?(?P<POT>[%(NUM)s]+)\)(, mucked| with.*)?" % self.substitutions, re.MULTILINE)
self.re_SitsOut = re.compile(r"^%s sits out" % player_re, re.MULTILINE)
self.re_ShownCards = re.compile(r"^Seat (?P<SEAT>[0-9]+): %s (\(button\) |\(small blind\) |\(big blind\) )?(?P<ACT>showed|mucked) \[(?P<CARDS>.*)\](( and won \(.*\) with | and lost with | \- )(?P<STRING>.*))?" % player_re, re.MULTILINE)
self.re_ShownCards = re.compile(r"^Seat (?P<SEAT>[0-9]+): %s (\(button\) |\(small blind\) |\(big blind\) )?(?P<SHOWED>showed|mucked) \[(?P<CARDS>.*)\](( and won \(.*\) with | and lost with | \- )(?P<STRING>.*))?" % player_re, re.MULTILINE)
def readSupportedGames(self):
return [["ring", "hold", "nl"],
@ -525,11 +525,16 @@ class Fulltilt(HandHistoryConverter):
def readShownCards(self,hand):
for m in self.re_ShownCards.finditer(hand.handText):
if m.group('CARDS') is not None:
cards = m.group('CARDS')
cards = cards.split(' ') # needs to be a list, not a set--stud needs the order
string = m.group('STRING')
if m.group('ACT'):
hand.addShownCards(cards=m.group('CARDS').split(' '), player=m.group('PNAME'), shown = False, mucked = True, string = string)
else:
hand.addShownCards(cards=m.group('CARDS').split(' '), player=m.group('PNAME'), shown = True, mucked = False, string = string)
(shown, mucked) = (False, False)
if m.group('SHOWED') == "showed": shown = True
elif m.group('SHOWED') == "mucked": mucked = True
#print "DEBUG: hand.addShownCards(%s, %s, %s, %s)" %(cards, m.group('PNAME'), shown, mucked)
hand.addShownCards(cards=cards, player=m.group('PNAME'), shown=shown, mucked=mucked, string=string)
def guessMaxSeats(self, hand):
"""Return a guess at max_seats when not specified in HH."""

View File

@ -731,6 +731,7 @@ class Sql:
street3Seen BOOLEAN,
street4Seen BOOLEAN,
sawShowdown BOOLEAN,
showed BOOLEAN,
street1Aggr BOOLEAN,
street2Aggr BOOLEAN,
@ -871,6 +872,7 @@ class Sql:
street3Seen BOOLEAN,
street4Seen BOOLEAN,
sawShowdown BOOLEAN,
showed BOOLEAN,
street1Aggr BOOLEAN,
street2Aggr BOOLEAN,
@ -1010,6 +1012,7 @@ class Sql:
street3Seen INT,
street4Seen INT,
sawShowdown INT,
showed INT,
street1Aggr INT,
street2Aggr INT,
@ -4963,6 +4966,7 @@ class Sql:
street3Seen,
street4Seen,
sawShowdown,
showed,
wonAtSD,
street0Aggr,
street1Aggr,
@ -5071,7 +5075,7 @@ class Sql:
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s
%s, %s, %s
)"""
self.query['store_hands_actions'] = """insert into HandsActions (

View File

@ -127,7 +127,7 @@ def compare_handsplayers_file(filename, importer, errors):
# The stats match - continue
pass
else:
if stat == 'tourneyTypeId' or stat == 'tourneysPlayersIds':
if stat == 'tourneyTypeId' or stat == 'tourneysPlayersIds' or stat == 'showed':
# Not and error
pass
else: