Use saveActions and fastStoreHudCache in fpdb_import, etc.

This commit is contained in:
Ray
2009-03-15 17:40:01 -04:00
parent 6f927e6b7b
commit 6d292c50d9
3 changed files with 71 additions and 12 deletions
+65 -6
View File
@@ -26,18 +26,29 @@ MYSQL_INNODB=2
PGSQL=3
SQLITE=4
fastStoreHudCache=False # set this to True to test the new storeHudCache routine
fastStoreHudCache=True # set this to True to test the new storeHudCache routine
saveActions=True # set this to False to avoid storing action data
saveActions=False # set this to False to avoid storing action data
# Pros: speeds up imports
# Cons: no action data is saved, so you need to keep the hand histories
# variance not available on stats page
#stores a stud/razz hand into the database
def ring_stud(backend, db, cursor, base, category, site_hand_no, gametype_id, hand_start_time
def ring_stud(config, backend, db, cursor, base, category, site_hand_no, gametype_id, hand_start_time
,names, player_ids, start_cashes, antes, card_values, card_suits, winnings, rakes
,action_types, allIns, action_amounts, actionNos, hudImportData, maxSeats, tableName
,seatNos):
import_options = config.get_import_parameters()
if import_options['saveActions'] == 'True':
saveActions = True
else:
saveActions = False
if import_options['fastStoreHudCache'] == 'True':
fastStoreHudCache = True
else:
fastStoreHudCache = False
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
hands_id=fpdb_simple.storeHands(backend, db, cursor, site_hand_no, gametype_id
@@ -56,11 +67,27 @@ def ring_stud(backend, db, cursor, base, category, site_hand_no, gametype_id, ha
return hands_id
#end def ring_stud
def ring_holdem_omaha(backend, db, cursor, base, category, site_hand_no, gametype_id
def ring_holdem_omaha(config, backend, db, cursor, base, 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, allIns
,action_amounts, actionNos, hudImportData, maxSeats, tableName, seatNos):
"""stores a holdem/omaha hand into the database"""
import_options = config.get_import_parameters()
if import_options['saveActions'] == 'True':
saveActions = True
else:
saveActions = False
if import_options['fastStoreHudCache'] == 'True':
fastStoreHudCache = True
else:
fastStoreHudCache = False
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
hands_id=fpdb_simple.storeHands(backend, db, cursor, site_hand_no, gametype_id
,hand_start_time, names, tableName, maxSeats)
t0 = time()
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
t1 = time()
@@ -89,7 +116,7 @@ def ring_holdem_omaha(backend, db, cursor, base, category, site_hand_no, gametyp
return hands_id
#end def ring_holdem_omaha
def tourney_holdem_omaha(backend, db, cursor, base, category, siteTourneyNo, buyin, fee, knockout
def tourney_holdem_omaha(config, backend, db, cursor, base, category, siteTourneyNo, buyin, fee, knockout
,entries, prizepool, tourney_start, payin_amounts, ranks, tourneyTypeId
,siteId #end of tourney specific params
,site_hand_no, gametype_id, hand_start_time, names, player_ids
@@ -97,6 +124,22 @@ def tourney_holdem_omaha(backend, db, cursor, base, category, siteTourneyNo, buy
,board_suits, winnings, rakes, action_types, allIns, action_amounts
,actionNos, hudImportData, maxSeats, tableName, seatNos):
"""stores a tourney holdem/omaha hand into the database"""
import_options = config.get_import_parameters()
if import_options['saveActions'] == 'True':
saveActions = True
else:
saveActions = False
if import_options['fastStoreHudCache'] == 'True':
fastStoreHudCache = True
else:
fastStoreHudCache = False
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
hands_id=fpdb_simple.storeHands(backend, db, cursor, site_hand_no, gametype_id
,hand_start_time, names, tableName, maxSeats)
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
fpdb_simple.fill_board_cards(board_values, board_suits)
@@ -123,12 +166,28 @@ def tourney_holdem_omaha(backend, db, cursor, base, category, siteTourneyNo, buy
return hands_id
#end def tourney_holdem_omaha
def tourney_stud(backend, db, cursor, base, category, siteTourneyNo, buyin, fee, knockout, entries
def tourney_stud(config, backend, db, cursor, base, category, siteTourneyNo, buyin, fee, knockout, entries
,prizepool, tourneyStartTime, payin_amounts, ranks, tourneyTypeId, siteId
,siteHandNo, gametypeId, handStartTime, names, playerIds, startCashes, antes
,cardValues, cardSuits, winnings, rakes, actionTypes, allIns, actionAmounts
,actionNos, hudImportData, maxSeats, tableName, seatNos):
#stores a tourney stud/razz hand into the database
import_options = config.get_import_parameters()
if import_options['saveActions'] == 'True':
saveActions = True
else:
saveActions = False
if import_options['fastStoreHudCache'] == 'True':
fastStoreHudCache = True
else:
fastStoreHudCache = False
fpdb_simple.fillCardArrays(len(names), base, category, card_values, card_suits)
hands_id=fpdb_simple.storeHands(backend, db, cursor, site_hand_no, gametype_id
,hand_start_time, names, tableName, maxSeats)
fpdb_simple.fillCardArrays(len(names), base, category, cardValues, cardSuits)
tourney_id=fpdb_simple.store_tourneys(cursor, tourneyTypeId, siteTourneyNo, entries, prizepool, tourneyStartTime)