git39 - started to reactivate tourney support - split tourneys table in design and recreate code, but still need to update the code

This commit is contained in:
steffen123 2008-08-15 04:28:51 +01:00
parent 423753de17
commit 701a824ac6
6 changed files with 62 additions and 42 deletions

View File

@ -12,7 +12,6 @@ split install instructions into OS-specific and OS-independent section. expand r
expand instructions for profile file, again, the release-creator will cat it. expand instructions for profile file, again, the release-creator will cat it.
delete old mailing list and create fpdb-announce delete old mailing list and create fpdb-announce
finish updating filelist finish updating filelist
return sng support
update abbreviations.txt update abbreviations.txt
fix up bg colours in tv fix up bg colours in tv
ebuild: symlink doesnt work, USE gtk, more automation, update install-in-gentoo.txt, set permissions in it, copy docs to correct place, use games eclass or whatever to get games group notice, print notice about install-in-gentoo.txt and mysql --config ebuild: symlink doesnt work, USE gtk, more automation, update install-in-gentoo.txt, set permissions in it, copy docs to correct place, use games eclass or whatever to get games group notice, print notice about install-in-gentoo.txt and mysql --config

View File

@ -617,30 +617,15 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<TD><P><BR></P></TD> <TD><P><BR></P></TD>
</TR> </TR>
<TR VALIGN=TOP> <TR VALIGN=TOP>
<TD><P>siteId</P></TD> <TD><P>tourneyGametypeId</P></TD>
<TD><P>smallint</P></TD> <TD><P>smallint</P></TD>
<TD><P>References Sites.id</P></TD> <TD><P>References TourneyGametypes.id</P></TD>
</TR> </TR>
<TR VALIGN=TOP> <TR VALIGN=TOP>
<TD><P>siteTourneyNo</P></TD> <TD><P>siteTourneyNo</P></TD>
<TD><P>bigint</P></TD> <TD><P>bigint</P></TD>
<TD><P><BR></P></TD> <TD><P><BR></P></TD>
</TR> </TR>
<TR VALIGN=TOP>
<TD><P>buyin</P></TD>
<TD><P>int</P></TD>
<TD><P>Buy-in in cents. Without rebuy/add-on</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>fee</P></TD>
<TD><P>int</P></TD>
<TD><P><BR></P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>knockout</P></TD>
<TD><P>int</P></TD>
<TD><P><BR></P></TD>
</TR>
<TR VALIGN=TOP> <TR VALIGN=TOP>
<TD><P>entries</P></TD> <TD><P>entries</P></TD>
<TD><P>int</P></TD> <TD><P>int</P></TD>
@ -668,6 +653,45 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
</TR> </TR>
</TABLE> </TABLE>
<p><BR></P> <p><BR></P>
<p><B>Table TourneyGametypes</B></P>
<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=0>
<TR VALIGN=TOP>
<TD><P>Field name</P></TD>
<TD><P>Type</P></TD>
<TD><P>Comment</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>id</P></TD>
<TD><P>int</P></TD>
<TD><P><BR></P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>siteId</P></TD>
<TD><P>smallint</P></TD>
<TD><P>References Sites.id</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>buyin</P></TD>
<TD><P>int</P></TD>
<TD><P>Buy-in in cents. Without rebuy/add-on</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>fee</P></TD>
<TD><P>int</P></TD>
<TD><P><BR></P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>knockout</P></TD>
<TD><P>int</P></TD>
<TD><P><BR></P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>rebuyOrAddon</P></TD>
<TD><P>boolean</P></TD>
<TD><P>Whether rebuys or add-ons are possible</P></TD>
</TR>
</TABLE>
<p><BR></P>
<p><B>Table TourneysPlayers</B></P> <p><B>Table TourneysPlayers</B></P>
<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=0> <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=0>
<TR VALIGN=TOP> <TR VALIGN=TOP>

View File

@ -363,7 +363,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 = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event) self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy) self.window.connect("destroy", self.destroy)
self.window.set_title("Free Poker DB - version: alpha1+, git38") self.window.set_title("Free Poker DB - version: alpha1+, git39")
self.window.set_border_width(1) self.window.set_border_width(1)
self.window.set_size_request(1020,400) self.window.set_size_request(1020,400)
self.window.set_resizable(True) self.window.set_resizable(True)

View File

@ -47,7 +47,7 @@ class fpdb_db:
try: try:
self.cursor.execute("SELECT * FROM Settings") self.cursor.execute("SELECT * FROM Settings")
settings=self.cursor.fetchone() settings=self.cursor.fetchone()
if settings[0]!=38: if settings[0]!=39:
print "outdated database version - please recreate tables" print "outdated database version - please recreate tables"
except:# _mysql_exceptions.ProgrammingError: except:# _mysql_exceptions.ProgrammingError:
print "failed to read settings table - please recreate tables" print "failed to read settings table - please recreate tables"
@ -119,6 +119,7 @@ class fpdb_db:
self.cursor.execute("DROP TABLE IF EXISTS HandsActions;") self.cursor.execute("DROP TABLE IF EXISTS HandsActions;")
self.cursor.execute("DROP TABLE IF EXISTS HandsPlayers;") self.cursor.execute("DROP TABLE IF EXISTS HandsPlayers;")
self.cursor.execute("DROP TABLE IF EXISTS Hands;") self.cursor.execute("DROP TABLE IF EXISTS Hands;")
self.cursor.execute("DROP TABLE IF EXISTS TourneysGametypes;")
self.cursor.execute("DROP TABLE IF EXISTS TourneysPlayers;") self.cursor.execute("DROP TABLE IF EXISTS TourneysPlayers;")
self.cursor.execute("DROP TABLE IF EXISTS Tourneys;") self.cursor.execute("DROP TABLE IF EXISTS Tourneys;")
self.cursor.execute("DROP TABLE IF EXISTS Players;") self.cursor.execute("DROP TABLE IF EXISTS Players;")
@ -204,13 +205,18 @@ class fpdb_db:
card5Value smallint, card5Value smallint,
card5Suit char(1))""") card5Suit char(1))""")
self.create_table("""Tourneys ( self.create_table("""TourneysGametypes (
id INT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id), id INT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id),
siteId SMALLINT UNSIGNED, FOREIGN KEY (siteId) REFERENCES Sites(id), siteId SMALLINT UNSIGNED, FOREIGN KEY (siteId) REFERENCES Sites(id),
siteTourneyNo BIGINT,
buyin INT, buyin INT,
fee INT, fee INT,
knockout INT, knockout INT,
rebuyOrAddon BOOLEAN)""")
self.create_table("""Tourneys (
id INT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id),
tourneysGametypeId SMALLINT UNSIGNED, FOREIGN KEY (tourneysGametypeId) REFERENCES TourneysGametypes(id),
siteTourneyNo BIGINT,
entries INT, entries INT,
prizepool INT, prizepool INT,
startTime DATETIME, startTime DATETIME,
@ -309,7 +315,7 @@ class fpdb_db:
position CHAR(1))""") position CHAR(1))""")
self.cursor.execute("INSERT INTO Settings VALUES (38);") self.cursor.execute("INSERT INTO Settings VALUES (39);")
self.cursor.execute("INSERT INTO Sites VALUES (DEFAULT, \"Full Tilt Poker\", 'USD');") 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 Sites VALUES (DEFAULT, \"PokerStars\", 'USD');")
self.db.commit() self.db.commit()

View File

@ -113,12 +113,10 @@ def mainParser(db, cursor, site, category, hand):
entries=-1 entries=-1
prizepool=-1 prizepool=-1
if (category=="holdem" or category=="omahahi" or category=="omahahilo"): if (category=="holdem" or category=="omahahi" or category=="omahahilo"):
result = fpdb_save_to_db.tourney_holdem_omaha(cursor, category, siteTourneyNo, buyin, fee, result = fpdb_save_to_db.tourney_holdem_omaha(cursor, category, siteTourneyNo, buyin, fee, knockout, entries, prizepool, tourneyStartTime, payin_amounts, ranks,
knockout, entries, prizepool, tourneyStartTime, payin_amounts, ranks, siteHandNo, gametypeID, handStartTime, names, playerIDs, startCashes, positions, cardValues, cardSuits, boardValues, boardSuits, winnings, rakes, actionTypes, actionAmounts, actionNos, hudImportData)
siteHandNo, siteID, gametypeID, handStartTime, names, playerIDs,
startCashes, positions, cardValues, cardSuits, boardValues, boardSuits, winnings, rakes,
actionTypes, actionAmounts, hudImportData)
elif (category=="razz" or category=="studhi" or category=="studhilo"): elif (category=="razz" or category=="studhi" or category=="studhilo"):
raise fpdb_simple.FpdbError ("stud/razz are currently broken")
result = fpdb_save_to_db.tourney_stud(cursor, category, siteTourneyNo, buyin, fee, result = fpdb_save_to_db.tourney_stud(cursor, category, siteTourneyNo, buyin, fee,
knockout, entries, prizepool, tourneyStartTime, payin_amounts, ranks, knockout, entries, prizepool, tourneyStartTime, payin_amounts, ranks,
siteHandNo, siteID, gametypeID, handStartTime, names, playerIDs, siteHandNo, siteID, gametypeID, handStartTime, names, playerIDs,
@ -126,9 +124,7 @@ def mainParser(db, cursor, site, category, hand):
actionTypes, actionAmounts, hudImportData) actionTypes, actionAmounts, hudImportData)
else: else:
if (category=="holdem" or category=="omahahi" or category=="omahahilo"): if (category=="holdem" or category=="omahahi" or category=="omahahilo"):
result = fpdb_save_to_db.ring_holdem_omaha(cursor, category, siteHandNo, gametypeID, result = fpdb_save_to_db.ring_holdem_omaha(cursor, category, siteHandNo, gametypeID, handStartTime, names, playerIDs, startCashes, positions, cardValues, cardSuits, boardValues, boardSuits, winnings, rakes, actionTypes, actionAmounts, actionNos, hudImportData)
handStartTime, names, playerIDs, startCashes, positions, cardValues,
cardSuits, boardValues, boardSuits, winnings, rakes, actionTypes, actionAmounts, actionNos, hudImportData)
elif (category=="razz" or category=="studhi" or category=="studhilo"): elif (category=="razz" or category=="studhi" or category=="studhilo"):
raise fpdb_simple.FpdbError ("stud/razz are currently broken") raise fpdb_simple.FpdbError ("stud/razz are currently broken")
result = fpdb_save_to_db.ring_stud(cursor, category, siteHandNo, gametypeID, result = fpdb_save_to_db.ring_stud(cursor, category, siteHandNo, gametypeID,

View File

@ -37,10 +37,9 @@ def ring_stud(cursor, category, site_hand_no, gametype_id, hand_start_time,
return site_hand_no return site_hand_no
#end def ring_stud #end def ring_stud
#stores a holdem/omaha hand into the database def ring_holdem_omaha(cursor, category, site_hand_no, gametype_id, hand_start_time, names, player_ids, start_cashes, positions, card_values, card_suits, board_values, board_suits, winnings, rakes, action_types, action_amounts, actionNos, hudImportData):
def ring_holdem_omaha(cursor, category, site_hand_no, gametype_id, hand_start_time, """stores a holdem/omaha hand into the database"""
names, player_ids, start_cashes, positions, card_values, card_suits,
board_values, board_suits, winnings, rakes, action_types, action_amounts, actionNos, hudImportData):
#fill up the two player card arrays #fill up the two player card arrays
if (category=="holdem"): if (category=="holdem"):
fpdb_simple.fillCardArrays(len(names), 2, card_values, card_suits) fpdb_simple.fillCardArrays(len(names), 2, card_values, card_suits)
@ -64,13 +63,9 @@ def ring_holdem_omaha(cursor, category, site_hand_no, gametype_id, hand_start_ti
return site_hand_no return site_hand_no
#end def ring_holdem_omaha #end def ring_holdem_omaha
def tourney_holdem_omaha(cursor, category, site_tourney_no, buyin, fee, knockout, entries, prizepool, def tourney_holdem_omaha(cursor, category, site_tourney_no, buyin, fee, knockout, entries, prizepool, tourney_start, payin_amounts, ranks, #end of tourney specific params
tourney_start, payin_amounts, ranks, #end of tourney specific params site_hand_no, gametype_id, hand_start_time, names, player_ids, start_cashes, positions, card_values, card_suits, board_values, board_suits, winnings, rakes, action_types, action_amounts, actionNos, hudImportData):
site_hand_no, site_id, gametype_id, hand_start_time, names, player_ids, """stores a tourney holdem/omaha hand into the database"""
start_cashes, positions, card_values, card_suits,
board_values, board_suits, winnings, rakes,
action_types, action_amounts, hudImportData):
#stores a tourney stud/razz hand into the database
#fill up the two player card arrays #fill up the two player card arrays
if (category=="holdem"): if (category=="holdem"):
fpdb_simple.fillCardArrays(len(names), 2, card_values, card_suits) fpdb_simple.fillCardArrays(len(names), 2, card_values, card_suits)