determineGameType fixed for FTP, PLO working

This commit is contained in:
Worros 2009-02-22 18:07:11 +09:00
parent baae7af5e0
commit 232c0df33a
4 changed files with 26 additions and 94 deletions

View File

@ -22,48 +22,7 @@ import Configuration
from HandHistoryConverter import *
from time import strftime
# Everleaf HH format
# Everleaf Gaming Game #55208539
# ***** Hand history for game #55208539 *****
# Blinds $0.50/$1 NL Hold'em - 2008/09/01 - 13:35:01
# Table Speed Kuala
# Seat 1 is the button
# Total number of players: 9
# Seat 1: BadBeatBox ( $ 98.97 USD )
# Seat 3: EricBlade ( $ 73.96 USD )
# Seat 4: randy888 ( $ 196.50 USD )
# Seat 5: BaronSengir ( $ 182.80 USD )
# Seat 6: dogge ( $ 186.06 USD )
# Seat 7: wings ( $ 50 USD )
# Seat 8: schoffeltje ( $ 282.05 USD )
# Seat 9: harrydebeng ( $ 109.45 USD )
# Seat 10: smaragdar ( $ 96.50 USD )
# EricBlade: posts small blind [$ 0.50 USD]
# randy888: posts big blind [$ 1 USD]
# wings: posts big blind [$ 1 USD]
# ** Dealing down cards **
# Dealt to EricBlade [ qc, 3c ]
# BaronSengir folds
# dogge folds
# wings raises [$ 2.50 USD]
# schoffeltje folds
# harrydebeng calls [$ 3.50 USD]
# smaragdar raises [$ 15.50 USD]
# BadBeatBox folds
# EricBlade folds
# randy888 folds
# wings calls [$ 12 USD]
# harrydebeng folds
# ** Dealing Flop ** [ qs, 3d, 8h ]
# wings: bets [$ 34.50 USD]
# smaragdar calls [$ 34.50 USD]
# ** Dealing Turn ** [ 2d ]
# ** Dealing River ** [ 6c ]
# dogge shows [ 9h, 9c ]a pair of nines
# spicybum shows [ 5d, 6d ]a straight, eight high
# harrydebeng does not show cards
# smaragdar wins $ 102 USD from main pot with a pair of aces [ ad, ah, qs, 8h, 6c ]
# Class for converting Everleaf HH format.
class Everleaf(HandHistoryConverter):
def __init__(self, config, file):

View File

@ -20,51 +20,7 @@ import sys
import Configuration
from HandHistoryConverter import *
# FullTilt HH Format
#Full Tilt Poker Game #9403951181: Table CR - tay - $0.05/$0.10 - No Limit Hold'em - 9:40:20 ET - 2008/12/09
#Seat 1: rigoise ($15.95)
#Seat 2: K2dream ($6.70)
#Seat 4: ravens2216 ($10)
#Seat 5: rizkouner ($4)
#Seat 6: Sorrowful ($8.35)
#rigoise posts the small blind of $0.05
#K2dream posts the big blind of $0.10
#5 seconds left to act
#rizkouner posts $0.10
#The button is in seat #6
#*** HOLE CARDS ***
#Dealt to Sorrowful [8h Qc]
#ravens2216 folds
#rizkouner checks
#Sorrowful has 15 seconds left to act
#Sorrowful folds
#rigoise folds
#K2dream checks
#*** FLOP *** [9d Kc 5c]
#K2dream checks
#rizkouner checks
#*** TURN *** [9d Kc 5c] [5h]
#K2dream has 15 seconds left to act
#K2dream bets $0.20
#rizkouner calls $0.20
#*** RIVER *** [9d Kc 5c 5h] [6h]
#K2dream checks
#rizkouner has 15 seconds left to act
#rizkouner bets $0.20
#K2dream folds
#Uncalled bet of $0.20 returned to rizkouner
#rizkouner mucks
#rizkouner wins the pot ($0.60)
#*** SUMMARY ***
#Total pot $0.65 | Rake $0.05
#Board: [9d Kc 5c 5h 6h]
#Seat 1: rigoise (small blind) folded before the Flop
#Seat 2: K2dream (big blind) folded on the River
#Seat 4: ravens2216 didn't bet (folded)
#Seat 5: rizkouner collected ($0.60), mucked
#Seat 6: Sorrowful (button) didn't bet (folded)
#Seat N: rizkouner (button) showed [Jh Ah] and won ($0.70) with a pair of Threes
# FullTilt HH Format converter
class FullTilt(HandHistoryConverter):
def __init__(self, config, file):
@ -73,7 +29,7 @@ class FullTilt(HandHistoryConverter):
self.sitename = "FullTilt"
self.setFileType("text", "cp1252")
self.re_GameInfo = re.compile('- \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) -')
self.re_GameInfo = re.compile('- \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) - (?P<LTYPE>(No|Pot)) Limit (?P<GAME>(Hold\'em|Omaha))')
self.re_SplitHands = re.compile(r"\n\n+")
self.re_HandInfo = re.compile('.*#(?P<HID>[0-9]+): Table (?P<TABLE>[- a-zA-Z]+) (\((?P<TABLEATTRIBUTES>.+)\) )?- \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) - (?P<GAMETYPE>[a-zA-Z\' ]+) - (?P<DATETIME>.*)')
self.re_Button = re.compile('The button is in seat #(?P<BUTTON>\d+)')
@ -95,15 +51,32 @@ class FullTilt(HandHistoryConverter):
def readSupportedGames(self):
pass
return [["ring", "hold", "nl"],
["ring", "hold", "pl"]
["ring", "omaha", "pl"]
]
def determineGameType(self):
# Cheating with this regex, only support nlhe at the moment
gametype = ["ring", "hold", "nl"]
# Full Tilt Poker Game #10777181585: Table Deerfly (deep 6) - $0.01/$0.02 - Pot Limit Omaha Hi - 2:24:44 ET - 2009/02/22
# Full Tilt Poker Game #10773265574: Table Butte (6 max) - $0.01/$0.02 - Pot Limit Hold'em - 21:33:46 ET - 2009/02/21
# Full Tilt Poker Game #9403951181: Table CR - tay - $0.05/$0.10 - No Limit Hold'em - 9:40:20 ET - 2008/12/09
structure = "" # nl, pl, cn, cp, fl
game = ""
m = self.re_GameInfo.search(self.obs)
gametype = gametype + [m.group('SB')]
gametype = gametype + [m.group('BB')]
if m.group('LTYPE') == "No":
structure = "nl"
elif m.group('LTYPE') == "Pot":
structure = "pl"
if m.group('GAME') == "Hold\'em":
game = "hold"
if m.group('GAME') == "Omaha":
game = "omahahi"
gametype = ["ring", game, structure, m.group('SB'), m.group('BB')]
return gametype

View File

@ -345,7 +345,7 @@ Map the tuple self.gametype onto the pokerstars string describing it
"""
# currently it appears to be something like ["ring", "hold", "nl", sb, bb]:
gs = {"hold" : "Hold'em",
"omahahi" : "FIXME",
"omahahi" : "Omaha",
"omahahilo" : "FIXME",
"razz" : "Razz",
"studhi" : "FIXME",

View File

@ -114,7 +114,7 @@ class HandHistoryConverter:
if self.obs == "" or self.obs == None:
print "Did not read anything from file."
return
# Ugh
self.obs = self.obs.replace('\r\n', '\n')
outfile = open(self.ofile, 'w')
self.gametype = self.determineGameType()