p43 - implemented gametypes.base/.hiLo and more updates to table design

This commit is contained in:
steffen123 2008-08-17 02:46:23 +01:00
parent e9d8b685ec
commit 9531c8d85b
5 changed files with 51 additions and 19 deletions

View File

@ -3,8 +3,9 @@ Everything is subject to change and especially the order will often change. Patc
alpha2 (release by 17Aug)
======
implement gametypes.base/hiLo
implement hands.tableName/importTime HandsPlayers.seatNo
change tabledesign VALIGN
seperate and improve instructions for update
verify link in release notes
split install instructions into OS-specific and OS-independent section. expand release creator to concatenate.
@ -17,6 +18,7 @@ ebuild: symlink doesnt work, USE gtk, more automation, update install-in-gentoo.
alpha3
======
store raw hand in db
export settings[hud-defaultInterval] to conf
fix up bg colours in tv
fill the fold to CB/2B/3B cache fields
@ -35,8 +37,9 @@ printhand each and the 2/3 relevant printplayerflags respectively on ps-lhe-ring
before beta
===========
maybe remove siteId from gametypes
?change most cache fields to bigint to allow extremely big databases in excess of 2 or 4 million hands per stake and position?
optionally make tv positional
rakeback/frequent player points
gentoo ebuild: USE postgresql
skins
optionally combine FB/FS and CB/2B/3B

View File

@ -229,6 +229,11 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<TD><P>bigint</P></TD>
<TD><P><BR></P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>tableName</P></TD>
<TD><P>varchar(20)</P></TD>
<TD><P>The site's name for the current table</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>siteHandNo</P></TD>
<TD><P>bigint</P></TD>
@ -244,6 +249,11 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<TD><P>datetime (in UTC)</P></TD>
<TD><P>start date&amp;time of the hand</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>importTime</P></TD>
<TD><P>datetime (in UTC)</P></TD>
<TD><P>date&amp;time of import of this hand</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>seats</P></TD>
<TD><P>smallint</P></TD>
@ -322,8 +332,13 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<TR VALIGN=TOP>
<TD><P>position</P></TD>
<TD><P>char(1)</P></TD>
<TD><p>BB=B, SB=S, Button=0, Cutoff=1, etc.</P>
<P>This is used in holdem/omaha only.</P></TD>
<TD><p>BB=B, SB=S, Button=0, Cutoff=1, etc.<br>
This is used in holdem/omaha only.</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>seatNo</P></TD>
<TD><P>smallint</P></TD>
<TD><p>The seat in which the person was sitting - necessary for HUD</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>ante</P></TD>
@ -333,8 +348,8 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<TR VALIGN=TOP>
<TD><P>cardXValue</P></TD>
<TD><P>smallint</P></TD>
<TD><p>2-10=2-10, J=11, Q=12, K=13, A=14 (even in razz), unknown/no card=x</P>
<P>see note above table</P></TD>
<TD><p>2-10=2-10, J=11, Q=12, K=13, A=14 (even in razz), unknown/no card=x<br>
see note above table</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>cardXSuit</P></TD>

View File

@ -370,7 +370,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy)
self.window.set_title("Free Poker DB - version: alpha1+, p42")
self.window.set_title("Free Poker DB - version: alpha1+, p43")
self.window.set_border_width(1)
self.window.set_size_request(1020,400)
self.window.set_resizable(True)

View File

@ -47,7 +47,7 @@ class fpdb_db:
try:
self.cursor.execute("SELECT * FROM Settings")
settings=self.cursor.fetchone()
if settings[0]!=41:
if settings[0]!=43:
print "outdated or too new database version - please recreate tables"
except:# _mysql_exceptions.ProgrammingError:
print "failed to read settings table - please recreate tables"
@ -159,8 +159,10 @@ class fpdb_db:
id SMALLINT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id),
siteId SMALLINT UNSIGNED, FOREIGN KEY (siteId) REFERENCES Sites(id),
type char(4),
base char(4),
category varchar(9),
limitType char(2),
hiLo char(1),
smallBlind int,
bigBlind int,
smallBet int,
@ -184,11 +186,13 @@ class fpdb_db:
self.create_table("""Hands (
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id),
siteHandNo bigint,
tableName VARCHAR(20),
siteHandNo BIGINT,
gametypeId SMALLINT UNSIGNED, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id),
handStart DATETIME,
seats smallint,
comment text,
importTime DATETIME,
seats SMALLINT,
comment TEXT,
commentTs DATETIME)""")
self.create_table("""BoardCards (
@ -237,9 +241,10 @@ class fpdb_db:
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id),
handId BIGINT UNSIGNED, FOREIGN KEY (handId) REFERENCES Hands(id),
playerId INT UNSIGNED, FOREIGN KEY (playerId) REFERENCES Players(id),
startCash int,
position char(1),
ante int,
startCash INT,
position CHAR(1),
seatNo SMALLINT,
ante INT,
card1Value smallint,
card1Suit char(1),
@ -332,7 +337,7 @@ class fpdb_db:
riverCheckCallRaiseChance INT,
riverCheckCallRaiseDone INT)""")
self.cursor.execute("INSERT INTO Settings VALUES (41);")
self.cursor.execute("INSERT INTO Settings VALUES (43);")
self.cursor.execute("INSERT INTO Sites VALUES (DEFAULT, \"Full Tilt Poker\", 'USD');")
self.cursor.execute("INSERT INTO Sites VALUES (DEFAULT, \"PokerStars\", 'USD');")
self.cursor.execute("INSERT INTO TourneysGametypes (id) VALUES (DEFAULT);")

View File

@ -967,22 +967,31 @@ def recogniseGametypeID(cursor, topline, site_id, category, isTourney):#todo: th
try:
len(result)
except TypeError:
if (category=="holdem" or category=="omahahi" or category=="omahahilo"):
if category=="holdem" or category=="omahahi" or category=="omahahilo":
max_seats=10
base="hold"
else:
max_seats=8
base="stud"
if category=="holdem" or category=="omahahi" or category=="studhi":
hiLo='h'
elif category=="razz":
hiLo='l'
else:
hiLo='s'
if (limit_type=="fl"):
big_blind=small_bet #todo: read this
small_blind=big_blind/2 #todo: read this
cursor.execute("""INSERT INTO Gametypes
(siteId, type, category, limitType, smallBlind, bigBlind, smallBet, bigBet)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s)""", (site_id, type, category, limit_type, small_blind, big_blind, small_bet, big_bet))
(siteId, type, base, category, limitType, hiLo, smallBlind, bigBlind, smallBet, bigBet)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", (site_id, type, base, category, limit_type, hiLo, small_blind, big_blind, small_bet, big_bet))
cursor.execute ("SELECT id FROM Gametypes WHERE siteId=%s AND type=%s AND category=%s AND limitType=%s AND smallBet=%s AND bigBet=%s", (site_id, type, category, limit_type, small_bet, big_bet))
else:
cursor.execute("""INSERT INTO Gametypes
(siteId, type, category, limitType, smallBlind, bigBlind, smallBet, bigBet)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s)""", (site_id, type, category, limit_type, small_bet, big_bet, 0, 0))#remember, for these bet means blind
VALUES (%s, %s, %s, %s, %s, %s, %s, %s)""", (site_id, type, base, category, limit_type, hiLo, small_bet, big_bet, 0, 0))#remember, for these bet means blind
cursor.execute ("SELECT id FROM Gametypes WHERE siteId=%s AND type=%s AND category=%s AND limitType=%s AND smallBlind=%s AND bigBlind=%s", (site_id, type, category, limit_type, small_bet, big_bet))
result=cursor.fetchone()