p50 - added Hands.maxSeats

This commit is contained in:
steffen123 2008-08-18 02:45:06 +01:00
parent 1bfb744fc3
commit 6a5d1d6332
5 changed files with 12 additions and 6 deletions

View File

@ -259,6 +259,11 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<TD><P>smallint</P></TD> <TD><P>smallint</P></TD>
<TD><P>number of used seats (ie. that got dealt cards)</P></TD> <TD><P>number of used seats (ie. that got dealt cards)</P></TD>
</TR> </TR>
<TR VALIGN=TOP>
<TD><P>maxSeats</P></TD>
<TD><P>smallint</P></TD>
<TD><P>number of available seats</P></TD>
</TR>
<TR VALIGN=TOP> <TR VALIGN=TOP>
<TD><P>comment</P></TD> <TD><P>comment</P></TD>
<TD><P>text</P></TD> <TD><P>text</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 = 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+, p48") self.window.set_title("Free Poker DB - version: alpha1+, p50")
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]!=48: if settings[0]!=50:
print "outdated or too new database version - please recreate tables" print "outdated or too new 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"
@ -195,6 +195,7 @@ class fpdb_db:
handStart DATETIME, handStart DATETIME,
importTime DATETIME, importTime DATETIME,
seats SMALLINT, seats SMALLINT,
maxSeats SMALLINT,
comment TEXT, comment TEXT,
commentTs DATETIME)""") commentTs DATETIME)""")
@ -350,7 +351,7 @@ class fpdb_db:
street4CheckCallRaiseChance INT, street4CheckCallRaiseChance INT,
street4CheckCallRaiseDone INT)""") street4CheckCallRaiseDone INT)""")
self.cursor.execute("INSERT INTO Settings VALUES (48);") self.cursor.execute("INSERT INTO Settings VALUES (50);")
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.cursor.execute("INSERT INTO TourneysGametypes (id) VALUES (DEFAULT);") self.cursor.execute("INSERT INTO TourneysGametypes (id) VALUES (DEFAULT);")

View File

@ -50,7 +50,7 @@ def ring_holdem_omaha(cursor, category, site_hand_no, gametype_id, hand_start_ti
fpdb_simple.fill_board_cards(board_values, board_suits) fpdb_simple.fill_board_cards(board_values, board_suits)
hands_id=fpdb_simple.storeHands(cursor, site_hand_no, gametype_id, hand_start_time, names, tableName) hands_id=fpdb_simple.storeHands(cursor, site_hand_no, gametype_id, hand_start_time, names, tableName, maxSeats)
hands_players_ids=fpdb_simple.store_hands_players_holdem_omaha(cursor, category, hands_id, player_ids, start_cashes, positions, card_values, card_suits, winnings, rakes, seatNos) hands_players_ids=fpdb_simple.store_hands_players_holdem_omaha(cursor, category, hands_id, player_ids, start_cashes, positions, card_values, card_suits, winnings, rakes, seatNos)

View File

@ -1123,9 +1123,9 @@ def store_board_cards(cursor, hands_id, board_values, board_suits):
board_values[4], board_suits[4])) board_values[4], board_suits[4]))
#end def store_board_cards #end def store_board_cards
def storeHands(cursor, site_hand_no, gametype_id, hand_start_time, names, tableName): def storeHands(cursor, site_hand_no, gametype_id, hand_start_time, names, tableName, maxSeats):
#stores into table hands #stores into table hands
cursor.execute ("INSERT INTO Hands (siteHandNo, gametypeId, handStart, seats, tableName, importTime) VALUES (%s, %s, %s, %s, %s, %s)", (site_hand_no, gametype_id, hand_start_time, len(names), tableName, datetime.datetime.today())) cursor.execute ("INSERT INTO Hands (siteHandNo, gametypeId, handStart, seats, tableName, importTime, maxSeats) VALUES (%s, %s, %s, %s, %s, %s, %s)", (site_hand_no, gametype_id, hand_start_time, len(names), tableName, datetime.datetime.today(), maxSeats))
#todo: find a better way of doing this... #todo: find a better way of doing this...
cursor.execute("SELECT id FROM Hands WHERE siteHandNo=%s AND gametypeId=%s", (site_hand_no, gametype_id)) cursor.execute("SELECT id FROM Hands WHERE siteHandNo=%s AND gametypeId=%s", (site_hand_no, gametype_id))
return cursor.fetchall()[0][0] return cursor.fetchall()[0][0]