p48 - removed some redundant bracketed values from tv

renamed cache fields and added more to be flexible for stud style games. note that tv is not updated yet
added forums and bugtracker to website sidebar
This commit is contained in:
steffen123 2008-08-17 13:13:42 +01:00
parent ea5db15e10
commit 5612ee6637
9 changed files with 531 additions and 509 deletions

View File

@ -3,19 +3,21 @@ Everything is subject to change and especially the order will often change. Patc
alpha2 (release by 17Aug)
======
finish Cache generalisation from line 1814 onwards
add sf.net logo to webpage
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.
expand instructions for profile file, again, the release-creator will cat it.
delete old mailing list and create fpdb-announce
add instructions for mailing list to contacts
finish updating filelist
update abbreviations.txt
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
add minimal instructions for developing to git-instructions
alpha3
======
make sure totalProfit shows actual profit rather than winnings.
update abbreviations.txt
(steffen) finish bringing back tourney
store raw hand in db
export settings[hud-defaultInterval] to conf

View File

@ -1,139 +0,0 @@
I recommend using a free/libre operating system, meaning a GNU/Linux distribution or a BSD variant (e.g. Gentoo GNU/Linux or OpenBSD) for ethical and practical reasons. Would you buy a car where you're prohibited from opening the bonnet under threat of jail? If the answer is no you should by the same logic not use closed source software for real money Poker :)
Unfortunately you will always need one piece of unfree software: The poker client itself. Although not a direct dependency of fpdb you obviously will have a hard time putting this to productive use without running some poker client. As far as I know, only unfree clients are available. If you know better please let me know ASAP!
If you can be bothered please do contact your poker site(s) and ask them to release free/libre clients, even if it is only for Windows. But lets be realistic, the chance of a positive answer is very low.
Before I start the list a note on the databases, as of git96 I have yet to try using this with PostgreSQL, but if I'm not mistaken it should actually work by now (the stuff in fpdb-python at least).
If you use a package management system (e.g. if you have GNU/Linux or *BSD) just check that you have mysql, mysql-python and pygtk or postgresql, pygresql and pygtk. Your package manager will take care of the rest for you.
Make new entries in this format:
X. Program Name
===============
a. Optional?
b. Required Version and Why
c. Project Webpage
d. License
1. MySQL
========
a. Optional?
Choose MySQL or PostgreSQL
b. Required Version and Why
At least 3.23 required due to mysql-python.
I use 5.0.54 and 5.0.60-r1 (GNU/Linux) and 5.0.51b (Windows).
c. Project Webpage
http://www.mysql.com
d. License
GPL2
2. PostgreSQL
=============
a. Optional?
Choose MySQL or PostgreSQL
b. Required Version and Why
I use 8.0.15 (GNU/Linux) and 8.3.3 (Windows) but I am not aware of any incompatibilities
with older or newer versions, pls report success/failure.
c. Project Webpage
http://www.postgresql.org
d. License
BSD License
3. mysql-python
===============
a. Optional?
Required if you want to use MySQL backend
b. Required Version and Why
I use 1.2.2 but I am not aware of any incompatibilities with older or newer versions, pls report success/failure.
c. Project Webpage
http://sourceforge.net/projects/mysql-python/
d. License
SF lists GNU General Public License (GPL), Python License (CNRI Python License), Zope Public License.
Project states GPL without version in Pkg-info.
4. pygresql
===========
a. Optional?
Required if you want to use PostgreSQL backend
b. Required Version and Why
I use 3.6.2 but I am not aware of any incompatibilities with older or newer versions, pls report success/failure.
c. Project Webpage
http://www.pygresql.org/
d. License
http://www.pygresql.org/readme.html#copyright-notice (BSD License?)
Summary: "Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted[...]" plus Disclaimer.
5. Python
=========
a. Optional?
Required.
b. Required Version and Why
I use 2.4.4 and 2.5.2 but I am not aware of any incompatibilities with older or newer versions, pls report success/failure.
c. Project Webpage
http://www.python.org
d. License
Python License
6. GTK+ and dependencies
=======
a. Optional?
Required.
b. Required Version and Why
I use 2.12.9 but it should run with 2.10 or higher. That is needed as I used MessageDialog updates
c. Project Webpage
Main: http://www.gtk.org/
API spec: http://library.gnome.org/devel/gtk/2.12/
Windows DLs (get the bundle unless you know what you're doing): http://www.gtk.org/download-windows.html
d. License
LGPL2
7. PyCairo
==========
a. Optional?
Required.
b. Required Version and Why
?
c. Project Webpage
main: http://www.pygtk.org
d. License
LGPL2.1
8. PyGObject
============
a. Optional?
Required.
b. Required Version and Why
?
c. Project Webpage
main: http://www.pygtk.org
d. License
LGPL2.1
9. PyGTK
========
a. Optional?
Required.
b. Required Version and Why
?
c. Project Webpage
main: http://www.pygtk.org
d. License
LGPL2.1
License (of this file)
=======
Trademarks of third parties have been used under Fair Use or similar laws.
Copyright 2008 Steffen Jobbagy-Felso
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.2 as published by the Free Software Foundation; with
no Invariant Sections, no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license can be found in fdl-1.2.txt
The program itself is licensed under AGPLv3, see agpl-3.0.txt

View File

@ -383,7 +383,7 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
</TR>
</TABLE>
<p><BR></P>
<P><B>Table HudDataHoldemOmaha</B></P>
<P><B>Table HudCache</B></P>
<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=0>
<TR VALIGN=TOP>
<TD><P><b>Field Name</b></P></TD>
@ -410,45 +410,61 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<TD><P>smallint</P></TD>
<TD><P>range 2-10</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>position</P></TD>
<TD><P>char(1)</P></TD>
<TD><P>Position for which this row applies. In this table this can be B(BB), S(SB), D(Dealer/Button), C(Cutoff), M(Middle - the 3 before cutoff) or E (Early - the 3 before Middle)</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>tourneysGametypeId</P></TD>
<TD><P>smallint</P></TD>
<TD><P>References TourneysGametypes.id</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>HDs</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands this player played in this gametype with this number of seats</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>VPIP</P></TD>
<TD><P>street0VPI</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player paid to see flop</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>PFR</P></TD>
<TD><P>street0Aggr</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player raised before flop</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>PF3B4BChance</P></TD>
<TD><P>street0_3B4BChance</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player had chance to 3B or 4B</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>PF3B4B</P></TD>
<TD><P>street0_3B4BDone</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player 3bet/4bet before flop</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>sawFlop</P></TD>
<TD><P>street1Seen</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player saw flop</P></TD>
<TD><P>number of hands where player saw flop/street4</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>sawTurn</P></TD>
<TD><P>street2Seen</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player saw turn</P></TD>
<TD><P>number of hands where player saw turn/street5</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>sawRiver</P></TD>
<TD><P>street3Seen</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player saw river</P></TD>
<TD><P>number of hands where player saw river/street6</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>street4Seen</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player saw street7</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>sawShowdown</P></TD>
@ -456,60 +472,75 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
<TD><P>number of hands where player saw showdown</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>raisedFlop</P></TD>
<TD><P>street1Aggr</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player raised flop</P></TD>
<TD><P>number of hands where player raised flop/street4</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>raisedTurn</P></TD>
<TD><P>street2Aggr</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player raised turn</P></TD>
<TD><P>number of hands where player raised turn/street5</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>raisedRiver</P></TD>
<TD><P>street3Aggr</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where player raised river</P></TD>
<TD><P>number of hands where player raised river/street6</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>otherRaisedFlop</P></TD>
<TD><P>street4Aggr</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised flop</P></TD>
<TD><P>number of hands where player raised street7</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>otherRaisedFlopFold</P></TD>
<TD><P>otherRaisedStreet1</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised flop and the player folded</P></TD>
<TD><P>number of hands where someone else raised flop/street4</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>otherRaisedTurn</P></TD>
<TD><P>otherRaisedStreet2</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised Turn</P></TD>
<TD><P>number of hands where someone else raised turn/street5</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>otherRaisedTurnFold</P></TD>
<TD><P>otherRaisedStreet3</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised Turn and the player folded</P></TD>
<TD><P>number of hands where someone else raised river/street6</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>otherRaisedRiver</P></TD>
<TD><P>otherRaisedStreet4</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised River</P></TD>
<TD><P>number of hands where someone else raised street7</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>otherRaisedRiverFold</P></TD>
<TD><P>foldToOtherRaisedStreet1</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised River and the player folded</P></TD>
<TD><P>number of hands where someone else raised flop/street4 and the player folded</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>wonWhenSeenFlop</P></TD>
<TD><P>foldToOtherRaisedStreet2</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised Turn/street5 and the player folded</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToOtherRaisedStreet3</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised River/street6 and the player folded</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToOtherRaisedStreet4</P></TD>
<TD><P>int</P></TD>
<TD><P>number of hands where someone else raised street7 and the player folded</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>wonWhenSeenStreet1</P></TD>
<TD><P>float</P></TD>
<TD><P>How many hands the player won after seeing the flop - this can be a "partial win" if the pot is split.<br>
<TD><P>How many hands the player won after seeing the flop/street4 - this can be a "partial win" if the pot is split.<br>
To be completely clear, this stores a hand count, NOT a money amount.</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>wonAtSD</P></TD>
<TD><P>float</P></TD>
<TD><P>As wonWhenSeenFlop, but for showdown.</P></TD>
<TD><P>As wonWhenSeenStreet1, but for showdown.</P></TD>
</TR>
<TR VALIGN=TOP>
@ -544,76 +575,85 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
</TR>
<TR VALIGN=TOP>
<TD><P>contBetChance</P></TD>
<TD><P>street1CBChance</P></TD>
<TD><P>int</P></TD>
<TD><P>Player had chance to make continuation bet</P></TD>
<TD><P>Player had chance to make continuation bet on flop/street4</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>contBetDone</P></TD>
<TD><P>street1CBDone</P></TD>
<TD><P>int</P></TD>
<TD><P>Player used chance to make continuation bet</P></TD>
<TD><P>Player used chance to make continuation bet on flop/street4</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>secondBarrelChance</P></TD>
<TD><P>street2CBChance</P></TD>
<TD><P>int</P></TD>
<TD><P>Player had chance to make second barrel bet</P></TD>
<TD><P>Player had chance to make continuation bet on turn/street5</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>secondBarrelDone</P></TD>
<TD><P>street2CBDone</P></TD>
<TD><P>int</P></TD>
<TD><P>Player used chance to make second barrel bet</P></TD>
<TD><P>Player used chance to make continuation bet on turn/street5</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>thirdBarrelChance</P></TD>
<TD><P>street3CBChance</P></TD>
<TD><P>int</P></TD>
<TD><P>Player had chance to make third barrel bet</P></TD>
<TD><P>Player had chance to make continuation bet on river/street6</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>thirdBarrelDone</P></TD>
<TD><P>street3CBDone</P></TD>
<TD><P>int</P></TD>
<TD><P>Player used chance to make third barrel bet</P></TD>
<TD><P>Player used chance to make continuation bet on river/street6</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>street4CBChance</P></TD>
<TD><P>int</P></TD>
<TD><P>Player had chance to make continuation bet on street7</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>street4CBDone</P></TD>
<TD><P>int</P></TD>
<TD><P>Player used chance to make continuation bet on street7</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>position</P></TD>
<TD><P>char(1)</P></TD>
<TD><P>Position for which this row applies. In this table this can be B(BB), S(SB), D(Dealer/Button), C(Cutoff), M(Middle - the 3 before cutoff) or E (Early - the 3 before Middle)</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>tourneysGametypeId</P></TD>
<TD><P>smallint</P></TD>
<TD><P>References TourneysGametypes.id</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToContBetChance</P></TD>
<TD><P>foldToStreet1CBChance</P></TD>
<TD><P>int</P></TD>
<TD><P>Player had chance to fold to continuation bet</P></TD>
<TD><P>Player had chance to fold to continuation bet on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToContBetDone</P></TD>
<TD><P>foldToStreet1CBDone</P></TD>
<TD><P>int</P></TD>
<TD><P>Player used chance to fold to continuation bet</P></TD>
<TD><P>Player used chance to fold to continuation bet on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToSecondBarrelChance</P></TD>
<TD><P>foldToStreet2CBChance</P></TD>
<TD><P>int</P></TD>
<TD><P>Player had chance to fold to second barrel bet</P></TD>
<TD><P>Player had chance to fold to continuation bet on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToSecondBarrelDone</P></TD>
<TD><P>foldToStreet2CBDone</P></TD>
<TD><P>int</P></TD>
<TD><P>Player used chance to fold to second barrel bet</P></TD>
<TD><P>Player used chance to fold to continuation bet on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToThirdBarrelChance</P></TD>
<TD><P>foldToStreet3CBChance</P></TD>
<TD><P>int</P></TD>
<TD><P>Player had chance to fold to third barrel bet</P></TD>
<TD><P>Player had chance to fold to continuation bet on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToThirdBarrelDone</P></TD>
<TD><P>foldToStreet3CBDone</P></TD>
<TD><P>int</P></TD>
<TD><P>Player used chance to fold to third barrel bet</P></TD>
<TD><P>Player used chance to fold to continuation bet on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToStreet4CBChance</P></TD>
<TD><P>int</P></TD>
<TD><P>Player had chance to fold to continuation bet on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>foldToStreet4CBDone</P></TD>
<TD><P>int</P></TD>
<TD><P>Player used chance to fold to continuation bet on this street</P></TD>
</TR>
<TR VALIGN=TOP>
@ -623,34 +663,44 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt</p>
</TR>
<TR VALIGN=TOP>
<TD><P>flopCheckCallRaiseChance</P></TD>
<TD><P>street1CheckCallRaiseChance</P></TD>
<TD><P>int</P></TD>
<TD><P>How often player had the chance to do a check-raise or a call-raise on the flop</P></TD>
<TD><P>How often player had the chance to do a check-raise or a call-raise on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>flopCheckCallRaiseDone</P></TD>
<TD><P>street1CheckCallRaiseDone</P></TD>
<TD><P>int</P></TD>
<TD><P>How often player used the chance to do a check-raise or a call-raise on the flop</P></TD>
<TD><P>How often player used the chance to do a check-raise or a call-raise on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>turnCheckCallRaiseChance</P></TD>
<TD><P>street2CheckCallRaiseChance</P></TD>
<TD><P>int</P></TD>
<TD><P>How often player had the chance to do a check-raise or a call-raise on the turn</P></TD>
<TD><P>How often player had the chance to do a check-raise or a call-raise on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>turnCheckCallRaiseDone</P></TD>
<TD><P>street2CheckCallRaiseDone</P></TD>
<TD><P>int</P></TD>
<TD><P>How often player used the chance to do a check-raise or a call-raise on the turn</P></TD>
<TD><P>How often player used the chance to do a check-raise or a call-raise on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>riverCheckCallRaiseChance</P></TD>
<TD><P>street3CheckCallRaiseChance</P></TD>
<TD><P>int</P></TD>
<TD><P>How often player had the chance to do a check-raise or a call-raise on the river</P></TD>
<TD><P>How often player had the chance to do a check-raise or a call-raise on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>riverCheckCallRaiseDone</P></TD>
<TD><P>street3CheckCallRaiseDone</P></TD>
<TD><P>int</P></TD>
<TD><P>How often player used the chance to do a check-raise or a call-raise on the river</P></TD>
<TD><P>How often player used the chance to do a check-raise or a call-raise on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>street4CheckCallRaiseChance</P></TD>
<TD><P>int</P></TD>
<TD><P>How often player had the chance to do a check-raise or a call-raise on this street</P></TD>
</TR>
<TR VALIGN=TOP>
<TD><P>street4CheckCallRaiseDone</P></TD>
<TD><P>int</P></TD>
<TD><P>How often player used the chance to do a check-raise or a call-raise on this street</P></TD>
</TR>
</TABLE>

View File

@ -156,8 +156,8 @@ class GuiTableViewer (threading.Thread):
tmp.append(self.hudDivide(row[15],row[11])+" ("+str(row[11])+")") #AR
tmp.append(self.hudDivide(row[21],row[20])+" ("+str(row[20])+")") #FR
tmp.append(self.hudDivide(row[12],row[9])+" ("+str(row[9])+")") #SD/F
tmp.append(self.hudDivide(row[22],row[9])+" ("+str(row[9])+")") #W$wSF
tmp.append(self.hudDivide(row[12],row[9])) #WtSD
tmp.append(self.hudDivide(row[22],row[9])) #W$wSF
tmp.append(self.hudDivide(row[23],row[12])+" ("+str(row[12])+")") #W$@SD
arr.append(tmp)

View File

@ -293,7 +293,7 @@ class fpdb:
elif lines[i].startswith("#"):
pass #comment - dont parse
else:
raise fpdb_simple.FpdbError("invalid line in profile file: "+lines[i])
raise fpdb_simple.FpdbError("invalid line in profile file: "+lines[i]+" if you don't know what to do just remove it from "+filename)
if self.db!=None:
self.db.disconnect()
@ -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+, p46")
self.window.set_title("Free Poker DB - version: alpha1+, p48")
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]!=45:
if settings[0]!=48:
print "outdated or too new database version - please recreate tables"
except:# _mysql_exceptions.ProgrammingError:
print "failed to read settings table - please recreate tables"
@ -112,8 +112,11 @@ class fpdb_db:
self.cursor.execute("DROP TABLE IF EXISTS gametypes;")
self.cursor.execute("DROP TABLE IF EXISTS sites;")
if oldDbVersion>34 and oldDbVersion<=45:
self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;")
self.cursor.execute("DROP TABLE IF EXISTS Settings;")
self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;")
self.cursor.execute("DROP TABLE IF EXISTS HudCache;")
self.cursor.execute("DROP TABLE IF EXISTS Autorates;")
self.cursor.execute("DROP TABLE IF EXISTS BoardCards;")
self.cursor.execute("DROP TABLE IF EXISTS HandsActions;")
@ -278,30 +281,37 @@ class fpdb_db:
comment TEXT,
commentTs DATETIME)""")
self.create_table("""HudDataHoldemOmaha (
self.create_table("""HudCache (
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT, PRIMARY KEY (id),
gametypeId SMALLINT UNSIGNED, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id),
playerId INT UNSIGNED, FOREIGN KEY (playerId) REFERENCES Players(id),
activeSeats SMALLINT,
position CHAR(1),
tourneysGametypeId SMALLINT UNSIGNED, FOREIGN KEY (tourneysGametypeId) REFERENCES TourneysGametypes(id),
HDs INT,
VPIP INT,
PFR INT,
PF3B4BChance INT,
PF3B4B INT,
sawFlop INT,
sawTurn INT,
sawRiver INT,
street0VPI INT,
street0Aggr INT,
street0_3B4BChance INT,
street0_3B4BDone INT,
street1Seen INT,
street2Seen INT,
street3Seen INT,
street4Seen INT,
sawShowdown INT,
raisedFlop INT,
raisedTurn INT,
raisedRiver INT,
otherRaisedFlop INT,
otherRaisedFlopFold INT,
otherRaisedTurn INT,
otherRaisedTurnFold INT,
otherRaisedRiver INT,
otherRaisedRiverFold INT,
wonWhenSeenFlop FLOAT,
street1Aggr INT,
street2Aggr INT,
street3Aggr INT,
street4Aggr INT,
otherRaisedStreet1 INT,
otherRaisedStreet2 INT,
otherRaisedStreet3 INT,
otherRaisedStreet4 INT,
foldToOtherRaisedStreet1 INT,
foldToOtherRaisedStreet2 INT,
foldToOtherRaisedStreet3 INT,
foldToOtherRaisedStreet4 INT,
wonWhenSeenStreet1 FLOAT,
wonAtSD FLOAT,
stealAttemptChance INT,
@ -311,33 +321,36 @@ class fpdb_db:
foldSbToStealChance INT,
foldedSbToSteal INT,
contBetChance INT,
contBetDone INT,
secondBarrelChance INT,
secondBarrelDone INT,
thirdBarrelChance INT,
thirdBarrelDone INT,
street1CBChance INT,
street1CBDone INT,
street2CBChance INT,
street2CBDone INT,
street3CBChance INT,
street3CBDone INT,
street4CBChance INT,
street4CBDone INT,
position CHAR(1),
tourneysGametypeId SMALLINT UNSIGNED, FOREIGN KEY (tourneysGametypeId) REFERENCES TourneysGametypes(id),
foldToContBetChance INT,
foldToContBetDone INT,
foldToSecondBarrelChance INT,
foldToSecondBarrelDone INT,
foldToThirdBarrelChance INT,
foldToThirdBarrelDone INT,
foldToStreet1CBChance INT,
foldToStreet1CBDone INT,
foldToStreet2CBChance INT,
foldToStreet2CBDone INT,
foldToStreet3CBChance INT,
foldToStreet3CBDone INT,
foldToStreet4CBChance INT,
foldToStreet4CBDone INT,
totalProfit INT,
flopCheckCallRaiseChance INT,
flopCheckCallRaiseDone INT,
turnCheckCallRaiseChance INT,
turnCheckCallRaiseDone INT,
riverCheckCallRaiseChance INT,
riverCheckCallRaiseDone INT)""")
street1CheckCallRaiseChance INT,
street1CheckCallRaiseDone INT,
street2CheckCallRaiseChance INT,
street2CheckCallRaiseDone INT,
street3CheckCallRaiseChance INT,
street3CheckCallRaiseDone INT,
street4CheckCallRaiseChance INT,
street4CheckCallRaiseDone INT)""")
self.cursor.execute("INSERT INTO Settings VALUES (45);")
self.cursor.execute("INSERT INTO Settings VALUES (48);")
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

@ -54,7 +54,7 @@ def ring_holdem_omaha(cursor, category, site_hand_no, gametype_id, hand_start_ti
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)
fpdb_simple.storeHudData(cursor, category, gametype_id, player_ids, hudImportData)
fpdb_simple.storeHudCache(cursor, category, gametype_id, player_ids, hudImportData)
fpdb_simple.store_board_cards(cursor, hands_id, board_values, board_suits)

View File

@ -1246,24 +1246,29 @@ def store_hands_players_stud_tourney(cursor, hands_id, player_ids, start_cashes,
def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings, totalWinnings, positions):
"""calculates data for the HUD during import. IMPORTANT: if you change this method make sure to also change the following storage method and table_viewer.prepare_data if necessary"""
#setup subarrays of the result dictionary.
VPIP=[]
PFR=[]
PF3B4BChance=[]
PF3B4B=[]
sawFlop=[]
sawTurn=[]
sawRiver=[]
street0VPI=[]
street0Aggr=[]
street0_3B4BChance=[]
street0_3B4BDone=[]
street1Seen=[]
street2Seen=[]
street3Seen=[]
street4Seen=[]
sawShowdown=[]
raisedFlop=[]
raisedTurn=[]
raisedRiver=[]
otherRaisedFlop=[]
otherRaisedFlopFold=[]
otherRaisedTurn=[]
otherRaisedTurnFold=[]
otherRaisedRiver=[]
otherRaisedRiverFold=[]
wonWhenSeenFlop=[]
street1Aggr=[]
street2Aggr=[]
street3Aggr=[]
street4Aggr=[]
otherRaisedStreet1=[]
otherRaisedStreet2=[]
otherRaisedStreet3=[]
otherRaisedStreet4=[]
foldToOtherRaisedStreet1=[]
foldToOtherRaisedStreet2=[]
foldToOtherRaisedStreet3=[]
foldToOtherRaisedStreet4=[]
wonWhenSeenStreet1=[]
wonAtSD=[]
stealAttemptChance=[]
stealAttempted=[]
@ -1308,24 +1313,28 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings
#run a loop for each player preparing the actual values that will be commited to SQL
for player in range (len(player_ids)):
#set default values
myVPIP=False
myPFR=False
myPF3B4BChance=False
myPF3B4B=False
mySawFlop=False
mySawTurn=False
mySawRiver=False
myStreet0VPI=False
myStreet0Aggr=False
myStreet0_3B4BChance=False
myStreet0_3B4BDone=False
myStreet1Seen=False
myStreet2Seen=False
myStreet3Seen=False
myStreet4Seen=False
mySawShowdown=False
myRaisedFlop=False
myRaisedTurn=False
myRaisedRiver=False
myOtherRaisedFlop=False
myOtherRaisedFlopFold=False
myOtherRaisedTurn=False
myOtherRaisedTurnFold=False
myOtherRaisedRiver=False
myOtherRaisedRiverFold=False
myWonWhenSeenFlop=0.0
myStreet1Aggr=False
myStreet2Aggr=False
myStreet3Aggr=False
myStreet4Aggr=False
myOtherRaisedStreet1=False
myOtherRaisedStreet2=False
myOtherRaisedStreet3=False
myOtherRaisedStreet4=False
myFoldToOtherRaisedStreet1=False
myFoldToOtherRaisedStreet2=False
myFoldToOtherRaisedStreet3=False
myFoldToOtherRaisedStreet4=False
myWonWhenSeenStreet1=0.0
myWonAtSD=0.0
myStealAttemptChance=False
myStealAttempted=False
@ -1336,9 +1345,9 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings
for count in range (len(action_types[street][player])):#finally individual actions
currentAction=action_types[street][player][count]
if currentAction=="bet":
myPFR=True
myStreet0Aggr=True
if (currentAction=="bet" or currentAction=="call"):
myVPIP=True
myStreet0VPI=True
#PF3B4BChance and PF3B4B
pfFold=-1
@ -1351,11 +1360,10 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings
if actionTypeByNo[0][i][1]=="fold" and pfFold==-1:
pfFold=i
if pfFold==-1 or pfFold>firstPfRaiseByNo:
myPF3B4BChance=True
myStreet0_3B4BChance=True
if pfRaise>firstPfRaiseByNo:
myPF3B4B=True
myStreet0_3B4BDone=True
#myStealAttemptChance myStealAttempted myFoldBbToStealChance myFoldedBbToSteal myFoldSbToStealChance myFoldedSbToSteal
#steal calculations
if len(player_ids)>=5: #no point otherwise
if positions[player]==1:
@ -1384,11 +1392,11 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings
#calculate saw* values
if (len(action_types[1][player])>0):
mySawFlop=True
myStreet1Seen=True
if (len(action_types[2][player])>0):
mySawTurn=True
myStreet2Seen=True
if (len(action_types[3][player])>0):
mySawRiver=True
myStreet3Seen=True
mySawShowdown=True
for count in range (len(action_types[3][player])):
if action_types[3][player][count]=="fold":
@ -1396,84 +1404,87 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings
#flop stuff
street=1
if mySawFlop:
if myStreet1Seen:
for count in range(len(action_types[street][player])):
if action_types[street][player][count]=="bet":
myRaisedFlop=True
myStreet1Aggr=True
for otherPlayer in range (len(player_ids)):
if player==otherPlayer or myOtherRaisedFlop:
if player==otherPlayer:
pass
else:
for countOther in range (len(action_types[street][otherPlayer])):
if action_types[street][otherPlayer][countOther]=="bet":
myOtherRaisedFlop=True
myOtherRaisedStreet1=True
for countOtherFold in range (len(action_types[street][player])):
if action_types[street][player][countOtherFold]=="fold":
myOtherRaisedFlopFold=True
myFoldToOtherRaisedStreet1=True
#turn stuff - copy of flop with different vars
street=2
if mySawTurn:
if myStreet2Seen:
for count in range(len(action_types[street][player])):
if action_types[street][player][count]=="bet":
myRaisedTurn=True
myStreet2Aggr=True
for otherPlayer in range (len(player_ids)):
if player==otherPlayer or myOtherRaisedTurn:
if player==otherPlayer:
pass
else:
for countOther in range (len(action_types[street][otherPlayer])):
if action_types[street][otherPlayer][countOther]=="bet":
myOtherRaisedTurn=True
myOtherRaisedStreet2=True
for countOtherFold in range (len(action_types[street][player])):
if action_types[street][player][countOtherFold]=="fold":
myOtherRaisedTurnFold=True
myFoldToOtherRaisedStreet2=True
#turn stuff - copy of flop with different vars
#river stuff - copy of flop with different vars
street=3
if mySawRiver:
if myStreet3Seen:
for count in range(len(action_types[street][player])):
if action_types[street][player][count]=="bet":
myRaisedRiver=True
myStreet3Aggr=True
for otherPlayer in range (len(player_ids)):
if player==otherPlayer or myOtherRaisedRiver:
if player==otherPlayer:
pass
else:
for countOther in range (len(action_types[street][otherPlayer])):
if action_types[street][otherPlayer][countOther]=="bet":
myOtherRaisedRiver=True
myOtherRaisedStreet3=True
for countOtherFold in range (len(action_types[street][player])):
if action_types[street][player][countOtherFold]=="fold":
myOtherRaisedRiverFold=True
myFoldToOtherRaisedStreet3=True
if winnings[player]!=0:
if mySawFlop:
myWonWhenSeenFlop=winnings[player]/float(totalWinnings)
#print "myWonWhenSeenFlop:",myWonWhenSeenFlop
if myStreet1Seen:
myWonWhenSeenStreet1=winnings[player]/float(totalWinnings)
if mySawShowdown:
myWonAtSD=myWonWhenSeenFlop
myWonAtSD=myWonWhenSeenStreet1
#add each value to the appropriate array
VPIP.append(myVPIP)
PFR.append(myPFR)
PF3B4BChance.append(myPF3B4BChance)
PF3B4B.append(myPF3B4B)
sawFlop.append(mySawFlop)
sawTurn.append(mySawTurn)
sawRiver.append(mySawRiver)
street0VPI.append(myStreet0VPI)
street0Aggr.append(myStreet0Aggr)
street0_3B4BChance.append(myStreet0_3B4BChance)
street0_3B4BDone.append(myStreet0_3B4BDone)
street1Seen.append(myStreet1Seen)
street2Seen.append(myStreet2Seen)
street3Seen.append(myStreet3Seen)
street4Seen.append(myStreet4Seen)
sawShowdown.append(mySawShowdown)
raisedFlop.append(myRaisedFlop)
raisedTurn.append(myRaisedTurn)
raisedRiver.append(myRaisedRiver)
otherRaisedFlop.append(myOtherRaisedFlop)
otherRaisedFlopFold.append(myOtherRaisedFlopFold)
otherRaisedTurn.append(myOtherRaisedTurn)
otherRaisedTurnFold.append(myOtherRaisedTurnFold)
otherRaisedRiver.append(myOtherRaisedRiver)
otherRaisedRiverFold.append(myOtherRaisedRiverFold)
wonWhenSeenFlop.append(myWonWhenSeenFlop)
street1Aggr.append(myStreet1Aggr)
street2Aggr.append(myStreet2Aggr)
street3Aggr.append(myStreet3Aggr)
street4Aggr.append(myStreet4Aggr)
otherRaisedStreet1.append(myOtherRaisedStreet1)
otherRaisedStreet2.append(myOtherRaisedStreet2)
otherRaisedStreet3.append(myOtherRaisedStreet3)
otherRaisedStreet4.append(myOtherRaisedStreet4)
foldToOtherRaisedStreet1.append(myFoldToOtherRaisedStreet1)
foldToOtherRaisedStreet2.append(myFoldToOtherRaisedStreet2)
foldToOtherRaisedStreet3.append(myFoldToOtherRaisedStreet3)
foldToOtherRaisedStreet4.append(myFoldToOtherRaisedStreet4)
wonWhenSeenStreet1.append(myWonWhenSeenStreet1)
wonAtSD.append(myWonAtSD)
stealAttemptChance.append(myStealAttemptChance)
stealAttempted.append(myStealAttempted)
@ -1494,29 +1505,34 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings
raise FpdbError("invalid position")
#add each array to the to-be-returned dictionary
result={'VPIP':VPIP}
result['PFR']=PFR
result['PF3B4BChance']=PF3B4BChance
result['PF3B4B']=PF3B4B
result['sawFlop']=sawFlop
result['sawTurn']=sawTurn
result['sawRiver']=sawRiver
result={'street0VPI':street0VPI}
result['street0Aggr']=street0Aggr
result['street0_3B4BChance']=street0_3B4BChance
result['street0_3B4BDone']=street0_3B4BDone
result['street1Seen']=street1Seen
result['street2Seen']=street2Seen
result['street3Seen']=street3Seen
result['street4Seen']=street4Seen
result['sawShowdown']=sawShowdown
result['raisedFlop']=raisedFlop
result['otherRaisedFlop']=otherRaisedFlop
result['otherRaisedFlopFold']=otherRaisedFlopFold
result['raisedTurn']=raisedTurn
result['otherRaisedTurn']=otherRaisedTurn
result['otherRaisedTurnFold']=otherRaisedTurnFold
result['raisedRiver']=raisedRiver
result['otherRaisedRiver']=otherRaisedRiver
result['otherRaisedRiverFold']=otherRaisedRiverFold
result['wonWhenSeenFlop']=wonWhenSeenFlop
result['street1Aggr']=street1Aggr
result['otherRaisedStreet1']=otherRaisedStreet1
result['foldToOtherRaisedStreet1']=foldToOtherRaisedStreet1
result['street2Aggr']=street2Aggr
result['otherRaisedStreet2']=otherRaisedStreet2
result['foldToOtherRaisedStreet2']=foldToOtherRaisedStreet2
result['street3Aggr']=street3Aggr
result['otherRaisedStreet3']=otherRaisedStreet3
result['foldToOtherRaisedStreet3']=foldToOtherRaisedStreet3
result['street4Aggr']=street4Aggr
result['otherRaisedStreet4']=otherRaisedStreet4
result['foldToOtherRaisedStreet4']=foldToOtherRaisedStreet4
result['wonWhenSeenStreet1']=wonWhenSeenStreet1
result['wonAtSD']=wonAtSD
result['stealAttemptChance']=stealAttemptChance
result['stealAttempted']=stealAttempted
#after having calculated the above we now do second level calculations, so far just steal attempts.
#now the various steal values
foldBbToStealChance=[]
foldedBbToSteal=[]
foldSbToStealChance=[]
@ -1549,130 +1565,158 @@ def generateHudData(player_ids, category, action_types, actionTypeByNo, winnings
result['foldSbToStealChance']=foldSbToStealChance
result['foldedSbToSteal']=foldedSbToSteal
#now CB/2B/3B
contBetChance=[]
contBetDone=[]
#now CB
street1CBChance=[]
street1CBDone=[]
for player in range (len(player_ids)):
myContBetChance=False
myContBetDone=False
myStreet1CBChance=False
myStreet1CBDone=False
if PFR[player]:
myContBetChance=True
if raisedFlop[player]:
myContBetDone=True
if street0VPI[player]:
myStreet1CBChance=True
if street1Aggr[player]:
myStreet1CBDone=True
contBetChance.append(myContBetChance)
contBetDone.append(myContBetDone)
result['contBetChance']=contBetChance
result['contBetDone']=contBetDone
street1CBChance.append(myStreet1CBChance)
street1CBDone.append(myStreet1CBDone)
result['street1CBChance']=street1CBChance
result['street1CBDone']=street1CBDone
#now 2B
secondBarrelChance=[]
secondBarrelDone=[]
street2CBChance=[]
street2CBDone=[]
for player in range (len(player_ids)):
mySecondBarrelChance=False
mySecondBarrelDone=False
myStreet2CBChance=False
myStreet2CBDone=False
if contBetDone[player]:
mySecondBarrelChance=True
if raisedTurn[player]:
mySecondBarrelDone=True
if street1CBDone[player]:
myStreet2CBChance=True
if street2Aggr[player]:
myStreet2CBDone=True
secondBarrelChance.append(mySecondBarrelChance)
secondBarrelDone.append(mySecondBarrelDone)
result['secondBarrelChance']=secondBarrelChance
result['secondBarrelDone']=secondBarrelDone
street2CBChance.append(myStreet2CBChance)
street2CBDone.append(myStreet2CBDone)
result['street2CBChance']=street2CBChance
result['street2CBDone']=street2CBDone
#now 3B
thirdBarrelChance=[]
thirdBarrelDone=[]
street3CBChance=[]
street3CBDone=[]
for player in range (len(player_ids)):
myThirdBarrelChance=False
myThirdBarrelDone=False
myStreet3CBChance=False
myStreet3CBDone=False
if secondBarrelDone[player]:
myThirdBarrelChance=True
if raisedRiver[player]:
myThirdBarrelDone=True
if street2CBDone[player]:
myStreet3CBChance=True
if street3Aggr[player]:
myStreet3CBDone=True
thirdBarrelChance.append(myThirdBarrelChance)
thirdBarrelDone.append(myThirdBarrelDone)
result['thirdBarrelChance']=thirdBarrelChance
result['thirdBarrelDone']=thirdBarrelDone
street3CBChance.append(myStreet3CBChance)
street3CBDone.append(myStreet3CBDone)
result['street3CBChance']=street3CBChance
result['street3CBDone']=street3CBDone
#4B - todo, implement for stud/razz
street4CBChance=[]
street4CBDone=[]
for player in range (len(player_ids)):
myStreet4CBChance=False
myStreet4CBDone=False
street4CBChance.append(myStreet4CBChance)
street4CBDone.append(myStreet4CBDone)
result['street4CBChance']=street4CBChance
result['street4CBDone']=street4CBDone
result['position']=hudDataPositions
foldToContBetChance=[]
foldToContBetDone=[]
foldToSecondBarrelChance=[]
foldToSecondBarrelDone=[]
foldToThirdBarrelChance=[]
foldToThirdBarrelDone=[]
foldToStreet1CBChance=[]
foldToStreet1CBDone=[]
foldToStreet2CBChance=[]
foldToStreet2CBDone=[]
foldToStreet3CBChance=[]
foldToStreet3CBDone=[]
foldToStreet4CBChance=[]
foldToStreet4CBDone=[]
totalProfit=[]
flopCheckCallRaiseChance=[]
flopCheckCallRaiseDone=[]
turnCheckCallRaiseChance=[]
turnCheckCallRaiseDone=[]
riverCheckCallRaiseChance=[]
riverCheckCallRaiseDone=[]
street1CheckCallRaiseChance=[]
street1CheckCallRaiseDone=[]
street2CheckCallRaiseChance=[]
street2CheckCallRaiseDone=[]
street3CheckCallRaiseChance=[]
street3CheckCallRaiseDone=[]
street4CheckCallRaiseChance=[]
street4CheckCallRaiseDone=[]
for player in range (len(player_ids)):
myFoldToContBetChance=False
myFoldToContBetDone=False
myFoldToSecondBarrelChance=False
myFoldToSecondBarrelDone=False
myFoldToThirdBarrelChance=False
myFoldToThirdBarrelDone=False
myFoldToStreet1CBChance=False
myFoldToStreet1CBDone=False
myFoldToStreet2CBChance=False
myFoldToStreet2CBDone=False
myFoldToStreet3CBChance=False
myFoldToStreet3CBDone=False
myFoldToStreet4CBChance=False
myFoldToStreet4CBDone=False
myTotalProfit=0
myFlopCheckCallRaiseChance=False
myFlopCheckCallRaiseDone=False
myTurnCheckCallRaiseChance=False
myTurnCheckCallRaiseDone=False
myRiverCheckCallRaiseChance=False
myRiverCheckCallRaiseDone=False
myStreet1CheckCallRaiseChance=False
myStreet1CheckCallRaiseDone=False
myStreet2CheckCallRaiseChance=False
myStreet2CheckCallRaiseDone=False
myStreet3CheckCallRaiseChance=False
myStreet3CheckCallRaiseDone=False
myStreet4CheckCallRaiseChance=False
myStreet4CheckCallRaiseDone=False
foldToContBetChance.append(myFoldToContBetChance)
foldToContBetDone.append(myFoldToContBetDone)
foldToSecondBarrelChance.append(myFoldToSecondBarrelChance)
foldToSecondBarrelDone.append(myFoldToSecondBarrelDone)
foldToThirdBarrelChance.append(myFoldToThirdBarrelChance)
foldToThirdBarrelDone.append(myFoldToThirdBarrelDone)
foldToStreet1CBChance.append(myFoldToStreet1CBChance)
foldToStreet1CBDone.append(myFoldToStreet1CBDone)
foldToStreet2CBChance.append(myFoldToStreet2CBChance)
foldToStreet2CBDone.append(myFoldToStreet2CBDone)
foldToStreet3CBChance.append(myFoldToStreet3CBChance)
foldToStreet3CBDone.append(myFoldToStreet3CBDone)
foldToStreet4CBChance.append(myFoldToStreet4CBChance)
foldToStreet4CBDone.append(myFoldToStreet4CBDone)
totalProfit.append(myTotalProfit)
flopCheckCallRaiseChance.append(myFlopCheckCallRaiseChance)
flopCheckCallRaiseDone.append(myFlopCheckCallRaiseDone)
turnCheckCallRaiseChance.append(myTurnCheckCallRaiseChance)
turnCheckCallRaiseDone.append(myTurnCheckCallRaiseDone)
riverCheckCallRaiseChance.append(myRiverCheckCallRaiseChance)
riverCheckCallRaiseDone.append(myRiverCheckCallRaiseDone)
street1CheckCallRaiseChance.append(myStreet1CheckCallRaiseChance)
street1CheckCallRaiseDone.append(myStreet1CheckCallRaiseDone)
street2CheckCallRaiseChance.append(myStreet2CheckCallRaiseChance)
street2CheckCallRaiseDone.append(myStreet2CheckCallRaiseDone)
street3CheckCallRaiseChance.append(myStreet3CheckCallRaiseChance)
street3CheckCallRaiseDone.append(myStreet3CheckCallRaiseDone)
street4CheckCallRaiseChance.append(myStreet4CheckCallRaiseChance)
street4CheckCallRaiseDone.append(myStreet4CheckCallRaiseDone)
result['foldToContBetChance']=foldToContBetChance
result['foldToContBetDone']=foldToContBetDone
result['foldToSecondBarrelChance']=foldToSecondBarrelChance
result['foldToSecondBarrelDone']=foldToSecondBarrelDone
result['foldToThirdBarrelChance']=foldToThirdBarrelChance
result['foldToThirdBarrelDone']=foldToThirdBarrelDone
result['foldToStreet1CBChance']=foldToStreet1CBChance
result['foldToStreet1CBDone']=foldToStreet1CBDone
result['foldToStreet2CBChance']=foldToStreet2CBChance
result['foldToStreet2CBDone']=foldToStreet2CBDone
result['foldToStreet3CBChance']=foldToStreet3CBChance
result['foldToStreet3CBDone']=foldToStreet3CBDone
result['foldToStreet4CBChance']=foldToStreet4CBChance
result['foldToStreet4CBDone']=foldToStreet4CBDone
result['totalProfit']=totalProfit
result['flopCheckCallRaiseChance']=flopCheckCallRaiseChance
result['flopCheckCallRaiseDone']=flopCheckCallRaiseDone
result['turnCheckCallRaiseChance']=turnCheckCallRaiseChance
result['turnCheckCallRaiseDone']=turnCheckCallRaiseDone
result['riverCheckCallRaiseChance']=riverCheckCallRaiseChance
result['riverCheckCallRaiseDone']=riverCheckCallRaiseDone
result['street1CheckCallRaiseChance']=street1CheckCallRaiseChance
result['street1CheckCallRaiseDone']=street1CheckCallRaiseDone
result['street2CheckCallRaiseChance']=street2CheckCallRaiseChance
result['street2CheckCallRaiseDone']=street2CheckCallRaiseDone
result['street3CheckCallRaiseChance']=street3CheckCallRaiseChance
result['street3CheckCallRaiseDone']=street3CheckCallRaiseDone
result['street4CheckCallRaiseChance']=street4CheckCallRaiseChance
result['street4CheckCallRaiseDone']=street4CheckCallRaiseDone
return result
#end def calculateHudImport
def storeHudData(cursor, category, gametypeId, playerIds, hudImportData):
def storeHudCache(cursor, category, gametypeId, playerIds, hudImportData):
if (category=="holdem" or category=="omahahi" or category=="omahahilo"):
for player in range (len(playerIds)):
cursor.execute("SELECT * FROM HudDataHoldemOmaha WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s AND position=%s", (gametypeId, playerIds[player], len(playerIds), hudImportData['position'][player]))
cursor.execute("SELECT * FROM HudCache WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s AND position=%s", (gametypeId, playerIds[player], len(playerIds), hudImportData['position'][player]))
row=cursor.fetchone()
#print "gametypeId:", gametypeId, "playerIds[player]",playerIds[player], "len(playerIds):",len(playerIds), "row:",row
@ -1688,8 +1732,7 @@ def storeHudData(cursor, category, gametypeId, playerIds, hudImportData):
row.append(gametypeId)
row.append(playerIds[player])
row.append(len(playerIds))#seats
row.append(0)#HDs
for i in range(len(hudImportData)):
for i in range(len(hudImportData)+2):
row.append(0)
else:
@ -1698,71 +1741,122 @@ def storeHudData(cursor, category, gametypeId, playerIds, hudImportData):
for i in range(len(row)):
newrow.append(row[i])
row=newrow
row[4]+=1 #HDs
if hudImportData['VPIP'][player]: row[5]+=1
if hudImportData['PFR'][player]: row[6]+=1
if hudImportData['PF3B4BChance'][player]: row[7]+=1
if hudImportData['PF3B4B'][player]: row[8]+=1
if hudImportData['sawFlop'][player]: row[9]+=1
if hudImportData['sawTurn'][player]: row[10]+=1
if hudImportData['sawRiver'][player]: row[11]+=1
if hudImportData['sawShowdown'][player]: row[12]+=1
if hudImportData['raisedFlop'][player]: row[13]+=1
if hudImportData['raisedTurn'][player]: row[14]+=1
if hudImportData['raisedRiver'][player]: row[15]+=1
if hudImportData['otherRaisedFlop'][player]: row[16]+=1
if hudImportData['otherRaisedFlopFold'][player]: row[17]+=1
if hudImportData['otherRaisedTurn'][player]: row[18]+=1
if hudImportData['otherRaisedTurnFold'][player]: row[19]+=1
if hudImportData['otherRaisedRiver'][player]: row[20]+=1
if hudImportData['otherRaisedRiverFold'][player]: row[21]+=1
if hudImportData['wonWhenSeenFlop'][player]!=0.0: row[22]+=hudImportData['wonWhenSeenFlop'][player]
if hudImportData['wonAtSD'][player]!=0.0: row[23]+=hudImportData['wonAtSD'][player]
if hudImportData['stealAttemptChance'][player]: row[24]+=1
if hudImportData['stealAttempted'][player]: row[25]+=1
if hudImportData['foldBbToStealChance'][player]: row[26]+=1
if hudImportData['foldedBbToSteal'][player]: row[27]+=1
if hudImportData['foldSbToStealChance'][player]: row[28]+=1
if hudImportData['foldedSbToSteal'][player]: row[29]+=1
if hudImportData['contBetChance'][player]: row[30]+=1
if hudImportData['contBetDone'][player]: row[31]+=1
if hudImportData['secondBarrelChance'][player]: row[32]+=1
if hudImportData['secondBarrelDone'][player]: row[33]+=1
if hudImportData['thirdBarrelChance'][player]: row[34]+=1
if hudImportData['thirdBarrelDone'][player]: row[35]+=1
row[36]=hudImportData['position'][player]
row[4]=hudImportData['position'][player]
row[5]=1 #tourneysGametypeId
row[6]+=1 #HDs
if hudImportData['street0VPI'][player]: row[7]+=1
if hudImportData['street0Aggr'][player]: row[8]+=1
if hudImportData['street0_3B4BChance'][player]: row[9]+=1
if hudImportData['street0_3B4BDone'][player]: row[10]+=1
if hudImportData['street1Seen'][player]: row[11]+=1
if hudImportData['street2Seen'][player]: row[12]+=1
if hudImportData['street3Seen'][player]: row[13]+=1
if hudImportData['street4Seen'][player]: row[14]+=1
if hudImportData['sawShowdown'][player]: row[15]+=1
if hudImportData['street1Aggr'][player]: row[16]+=1
if hudImportData['street2Aggr'][player]: row[17]+=1
if hudImportData['street3Aggr'][player]: row[18]+=1
if hudImportData['street4Aggr'][player]: row[19]+=1
if hudImportData['otherRaisedStreet1'][player]: row[20]+=1
if hudImportData['otherRaisedStreet2'][player]: row[21]+=1
if hudImportData['otherRaisedStreet3'][player]: row[22]+=1
if hudImportData['otherRaisedStreet4'][player]: row[23]+=1
if hudImportData['foldToOtherRaisedStreet1'][player]: row[24]+=1
if hudImportData['foldToOtherRaisedStreet2'][player]: row[25]+=1
if hudImportData['foldToOtherRaisedStreet3'][player]: row[26]+=1
if hudImportData['foldToOtherRaisedStreet4'][player]: row[27]+=1
if hudImportData['wonWhenSeenStreet1'][player]!=0.0: row[28]+=hudImportData['wonWhenSeenStreet1'][player]
if hudImportData['wonAtSD'][player]!=0.0: row[29]+=hudImportData['wonAtSD'][player]
if hudImportData['stealAttemptChance'][player]: row[30]+=1
if hudImportData['stealAttempted'][player]: row[31]+=1
if hudImportData['foldBbToStealChance'][player]: row[32]+=1
if hudImportData['foldedBbToSteal'][player]: row[33]+=1
if hudImportData['foldSbToStealChance'][player]: row[34]+=1
if hudImportData['foldedSbToSteal'][player]: row[35]+=1
if hudImportData['foldToContBetChance'][player]: row[37]+=1
if hudImportData['foldToContBetDone'][player]: row[38]+=1
if hudImportData['foldToSecondBarrelChance'][player]: row[39]+=1
if hudImportData['foldToSecondBarrelDone'][player]: row[40]+=1
if hudImportData['foldToThirdBarrelChance'][player]: row[41]+=1
if hudImportData['foldToThirdBarrelDone'][player]: row[42]+=1
if hudImportData['street1CBChance'][player]: row[36]+=1
if hudImportData['street1CBDone'][player]: row[37]+=1
if hudImportData['street2CBChance'][player]: row[38]+=1
if hudImportData['street2CBDone'][player]: row[39]+=1
if hudImportData['street3CBChance'][player]: row[40]+=1
if hudImportData['street3CBDone'][player]: row[41]+=1
if hudImportData['street4CBChance'][player]: row[42]+=1
if hudImportData['street4CBDone'][player]: row[43]+=1
if hudImportData['foldToStreet1CBChance'][player]: row[44]+=1
if hudImportData['foldToStreet1CBDone'][player]: row[45]+=1
if hudImportData['foldToStreet2CBChance'][player]: row[46]+=1
if hudImportData['foldToStreet2CBDone'][player]: row[47]+=1
if hudImportData['foldToStreet3CBChance'][player]: row[48]+=1
if hudImportData['foldToStreet3CBDone'][player]: row[49]+=1
if hudImportData['foldToStreet4CBChance'][player]: row[50]+=1
if hudImportData['foldToStreet4CBDone'][player]: row[51]+=1
row[43]+=hudImportData['totalProfit'][player]
row[52]+=hudImportData['totalProfit'][player]
if hudImportData['flopCheckCallRaiseChance'][player]: row[44]+=1
if hudImportData['flopCheckCallRaiseDone'][player]: row[45]+=1
if hudImportData['turnCheckCallRaiseChance'][player]: row[46]+=1
if hudImportData['turnCheckCallRaiseDone'][player]: row[47]+=1
if hudImportData['riverCheckCallRaiseChance'][player]: row[48]+=1
if hudImportData['riverCheckCallRaiseDone'][player]: row[49]+=1
if hudImportData['street1CheckCallRaiseChance'][player]: row[53]+=1
if hudImportData['street1CheckCallRaiseDone'][player]: row[54]+=1
if hudImportData['street2CheckCallRaiseChance'][player]: row[55]+=1
if hudImportData['street2CheckCallRaiseDone'][player]: row[56]+=1
if hudImportData['street3CheckCallRaiseChance'][player]: row[57]+=1
if hudImportData['street3CheckCallRaiseDone'][player]: row[58]+=1
if hudImportData['street4CheckCallRaiseChance'][player]: row[59]+=1
if hudImportData['street4CheckCallRaiseDone'][player]: row[60]+=1
if doInsert:
#print "playerid before insert:",row[2]
cursor.execute("""INSERT INTO HudDataHoldemOmaha
(gametypeId, playerId, activeSeats, HDs, VPIP, PFR, PF3B4BChance, PF3B4B, sawFlop, sawTurn, sawRiver, sawShowdown, raisedFlop, raisedTurn, raisedRiver, otherRaisedFlop, otherRaisedFlopFold, otherRaisedTurn, otherRaisedTurnFold, otherRaisedRiver, otherRaisedRiverFold, wonWhenSeenFlop, wonAtSD, stealAttemptChance, stealAttempted, foldBbToStealChance, foldedBbToSteal, foldSbToStealChance, foldedSbToSteal, contBetChance, contBetDone, secondBarrelChance, secondBarrelDone, thirdBarrelChance, thirdBarrelDone, position, tourneysGametypeId, foldToContBetChance, foldToContBetDone, foldToSecondBarrelChance, foldToSecondBarrelDone, foldToThirdBarrelChance, foldToThirdBarrelDone, totalProfit, flopCheckCallRaiseChance, flopCheckCallRaiseDone, turnCheckCallRaiseChance, turnCheckCallRaiseDone, riverCheckCallRaiseChance, riverCheckCallRaiseDone)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", (row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17], row[18], row[19], row[20], row[21], row[22], row[23], row[24], row[25], row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[33], row[34], row[35], row[36], 1, row[37], row[38], row[39], row[40], row[41], row[42], row[43], row[44], row[45], row[46], row[47], row[48], row[49]))
cursor.execute("""INSERT INTO HudCache
(gametypeId, playerId, activeSeats, position, tourneysGametypeId,
HDs, street0VPI, street0Aggr, street0_3B4BChance, street0_3B4BDone,
street1Seen, street2Seen, street3Seen, street4Seen, sawShowdown,
street1Aggr, street2Aggr, street3Aggr, street4Aggr, otherRaisedStreet1,
otherRaisedStreet2, otherRaisedStreet3, otherRaisedStreet4, foldToOtherRaisedStreet1, foldToOtherRaisedStreet2,
foldToOtherRaisedStreet3, foldToOtherRaisedStreet4, wonWhenSeenStreet1, wonAtSD, stealAttemptChance,
stealAttempted, foldBbToStealChance, foldedBbToSteal, foldSbToStealChance, foldedSbToSteal,
street1CBChance, street1CBDone, street2CBChance, street2CBDone, street3CBChance,
street3CBDone, street4CBChance, street4CBDone, foldToStreet1CBChance, foldToStreet1CBDone,
foldToStreet2CBChance, foldToStreet2CBDone, foldToStreet3CBChance, foldToStreet3CBDone, foldToStreet4CBChance,
foldToStreet4CBDone, totalProfit, street1CheckCallRaiseChance, street1CheckCallRaiseDone, street2CheckCallRaiseChance,
street2CheckCallRaiseDone, street3CheckCallRaiseChance, street3CheckCallRaiseDone, street4CheckCallRaiseChance, street4CheckCallRaiseDone)
VALUES (%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s,
%s, %s, %s, %s, %s)""", (row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17], row[18], row[19], row[20], row[21], row[22], row[23], row[24], row[25], row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[33], row[34], row[35], row[36], row[37], row[38], row[39], row[40], row[41], row[42], row[43], row[44], row[45], row[46], row[47], row[48], row[49], row[50], row[51], row[52], row[53], row[54], row[55], row[56], row[57], row[58], row[59], row[60]))
else:
#print "storing updated hud data line"
cursor.execute("""UPDATE HudDataHoldemOmaha
SET HDs=%s, VPIP=%s, PFR=%s, PF3B4BChance=%s, PF3B4B=%s, sawFlop=%s, sawTurn=%s, sawRiver=%s, sawShowdown=%s, raisedFlop=%s, raisedTurn=%s, raisedRiver=%s, otherRaisedFlop=%s, otherRaisedFlopFold=%s, otherRaisedTurn=%s, otherRaisedTurnFold=%s, otherRaisedRiver=%s, otherRaisedRiverFold=%s, wonWhenSeenFlop=%s, wonAtSD=%s, stealAttemptChance=%s, stealAttempted=%s, foldBbToStealChance=%s, foldedBbToSteal=%s, foldSbToStealChance=%s, foldedSbToSteal=%s, contBetChance=%s, contBetDone=%s, secondBarrelChance=%s, secondBarrelDone=%s, thirdBarrelChance=%s, thirdBarrelDone=%s, tourneysGametypeId=%s, foldToContBetChance=%s, foldToContBetDone=%s, foldToSecondBarrelChance=%s, foldToSecondBarrelDone=%s, foldToThirdBarrelChance=%s, foldToThirdBarrelDone=%s, totalProfit=%s, flopCheckCallRaiseChance=%s, flopCheckCallRaiseDone=%s, turnCheckCallRaiseChance=%s, turnCheckCallRaiseDone=%s, riverCheckCallRaiseChance=%s, riverCheckCallRaiseDone=%s
WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s AND position=%s""", (row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17], row[18], row[19], row[20], row[21], row[22], row[23], row[24], row[25], row[26], row[27], row[28], row[29], row[30], row[31], row[32], row[33], row[34], row[35], 1, row[37], row[38], row[39], row[40], row[41], row[42], row[43], row[44], row[45], row[46], row[47], row[48], row[49], row[1], row[2], row[3], row[36]))
cursor.execute("""UPDATE HudCache
SET HDs=%s, street0VPI=%s, street0Aggr=%s, street0_3B4BChance=%s, street0_3B4BDone=%s,
street1Seen=%s, street2Seen=%s, street3Seen=%s, street4Seen=%s, sawShowdown=%s,
street1Aggr=%s, street2Aggr=%s, street3Aggr=%s, street4Aggr=%s, otherRaisedStreet1=%s,
otherRaisedStreet2=%s, otherRaisedStreet3=%s, otherRaisedStreet4=%s, foldToOtherRaisedStreet1=%s, foldToOtherRaisedStreet2=%s,
foldToOtherRaisedStreet3=%s, foldToOtherRaisedStreet4=%s, wonWhenSeenStreet1=%s, wonAtSD=%s, stealAttemptChance=%s,
stealAttempted=%s, foldBbToStealChance=%s, foldedBbToSteal=%s, foldSbToStealChance=%s, foldedSbToSteal=%s,
street1CBChance=%s, street1CBDone=%s, street2CBChance=%s, street2CBDone=%s, street3CBChance=%s,
street3CBDone=%s, street4CBChance=%s, street4CBDone=%s, foldToStreet1CBChance=%s, foldToStreet1CBDone=%s,
foldToStreet2CBChance=%s, foldToStreet2CBDone=%s, foldToStreet3CBChance=%s, foldToStreet3CBDone=%s, foldToStreet4CBChance=%s,
foldToStreet4CBDone=%s, totalProfit=%s, street1CheckCallRaiseChance=%s, street1CheckCallRaiseDone=%s, street2CheckCallRaiseChance=%s,
street2CheckCallRaiseDone=%s, street3CheckCallRaiseChance=%s, street3CheckCallRaiseDone=%s, street4CheckCallRaiseChance=%s, street4CheckCallRaiseDone=%s
WHERE gametypeId=%s AND playerId=%s AND activeSeats=%s AND position=%s AND tourneysGametypeId=%s""", (row[6], row[7], row[8], row[9], row[10],
row[11], row[12], row[13], row[14], row[15],
row[16], row[17], row[18], row[19], row[20],
row[21], row[22], row[23], row[24], row[25],
row[26], row[27], row[28], row[29], row[30],
row[31], row[32], row[33], row[34], row[35], row[36], row[37], row[38], row[39], row[40],
row[41], row[42], row[43], row[44], row[45], row[46], row[47], row[48], row[49], row[50],
row[51], row[52], row[53], row[54], row[55], row[56], row[57], row[58], row[59], row[60],
row[1], row[2], row[3], row[4], row[5]))
else:
raise FpdbError("todo")
#end def storeHudData
#end def storeHudCache
def store_tourneys(cursor, site_id, site_tourney_no, buyin, fee, knockout, entries, prizepool, start_time):
cursor.execute("SELECT id FROM Tourneys WHERE siteTourneyNo=%s AND siteId=%s", (site_tourney_no, site_id))

View File

@ -7,5 +7,7 @@
<li><a href="<?php echo SITE_URL ?>docs.php">Documentation</a></li>
<li><a href="<?php echo SITE_URL ?>license.php">License</a></li>
<li><a href="<?php echo SITE_URL ?>contact.php">Contact</a></li>
<li><a href="https://sourceforge.net/forum/?group_id=226872">Forums</a></li>
<li><a href="https://sourceforge.net/tracker/?group_id=226872">Bug/Request Tracker</a></li>
</ul>
</div>