* implement the new SessionsCache table
- The SessionsCache table can be used to track overall or game sepecific sessions
- The totalProfit field is summed by gameTypeId for cash games allowing for multiple currencies
- Tournament profit (cashes - buy-ins) are also recorded in totalProfit and its grouped by tourneyId
* change the sequence and methodology surrounding the import of hands
- fpdb_import.py implements a unique Hand.py method for each table
- Hands SessionCache and HudCache records themselves are 'cached' to allow for 'bulk insert' at EOF
- import is reorganized to allow for efficient locking in multiple connection environments
* changes the name of the index created by addTPlayersIndex (so that it is unique) to accommodate a bug in MySQL 5.5
TODO
* A 'rebuild_sessionsCache' method is still required
* Further commits are expected to fix bugs created during the porting of this code
When a player is listed as playing the hand and sits out between the listing and ante-up join_holecards returned only 2 cards causing Card.encodeRazzStartHand() to crash.
Make sure that join_holecards must return at least 3 cards for stud, and add an entry for this case in the lookup table
Go through and change all references to gameTypeId to gametypeId to make it consistent.
The database field is named with the lowercase version, and MySQL is case sensitive.
This may have been causing minor issues in multiple areas when attempting to join on gametype.
* Added a cacheSessions update call to import_file_dict() in fpdb_import.py
* Added updateSessionsCache() method to Hands
* Added storeSessionsCache() to Database --- WORK IN PROGRESS and set to pass
TO DOs
- add sessions queries to SQL
- complete storeSessionsCache() so it works like we've discussed (save for adding sessionId to HP)
- add SessionsCache keys
- add SessionsCache to the default table creation and deletion methods in Database.py
- update storeSessionsCache() and all the relevant db & sql code so it writes a sessionId to HP
* added logic to Hand.import() so that it only calls db.storeHandsActions if saveActions is true
* added logic to DetailedStats.getstats() so that it only calls assembleHandsActions() if saveActions is true
* Filled storeHandsActions() with the required information
* Updated Hand.insert so that it calls storeHandsActions() and added the variable dbid_hpid to receive the new dictionary
* edited addAnte(), addBlind(), addCall(), addBet(), addBlind() (Draw), addDiscard() (Draw),
addComplete() (Stud), and addBringIn() (Stud) to standardize element order and datatype
* added a field to _addRaise() which allows addComplete() (Stud) to pass the 'compleates' action type