How to get a special hand data?

For discussion of the Poker Mavens server module and other administration topics

How to get a special hand data?

Postby developer » Fri Feb 06, 2015 12:53 am

Hello
I need to save each hand data seperately in db ,but when i request a hand history with the Name and Date the system brings me several hands with several dates in a long string.
How can i get just one hand data?
developer
 
Posts: 21
Joined: Sat Dec 13, 2014 9:27 am

Re: How to get a special hand data?

Postby Kent Briggs » Fri Feb 06, 2015 1:38 am

developer wrote:I need to save each hand data seperately in db ,but when i request a hand history with the Name and Date the system brings me several hands with several dates in a long string.
How can i get just one hand data?


Using the Name and Date parameters retrieves the entire hand history file for the day and table named. In legacy mode, that string has CR/LF characters separating each line. In JSON mode, each line is returned as an array element. Either way, you just loop through it looking for the start of each hand. The server also holds in memory the last 100 hands played and you can retrieve a single hand from there using the Hand parameter. You can use the Callback Event system to get notified each time a hand completes.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: How to get a special hand data?

Postby developer » Fri Feb 06, 2015 4:21 am

Well , you said
The server also holds in memory the last 100 hands played and you can retrieve a single hand from there using the Hand parameter

It means that in each log file is maximum 100 hands data . right?
developer
 
Posts: 21
Joined: Sat Dec 13, 2014 9:27 am

Re: How to get a special hand data?

Postby Kent Briggs » Fri Feb 06, 2015 10:33 am

developer wrote:It means that in each log file is maximum 100 hands data . right?


No, the log file will have the entire day's hands, for each table. Could be thousands of hands. The last 100 hands played are cached in memory and can be retrieved individually by hand number.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: How to get a special hand data?

Postby developer » Sat Feb 07, 2015 1:38 am

The last 100 hands played are cached in memory and can be retrieved individually by hand number

wooow Its what i`m looking for, how can i retrieve a hand by hand number from memory?
developer
 
Posts: 21
Joined: Sat Dec 13, 2014 9:27 am

Re: How to get a special hand data?

Postby Kent Briggs » Sat Feb 07, 2015 10:22 am

developer wrote:wooow Its what i`m looking for, how can i retrieve a hand by hand number from memory?


See the "Callback Events" group of settings at the bottom of the System tab. Set "Enable callbacks" to Yes, specify a script to run on a web site (typically pointing to a php file) as the "URL", and set "Hand event" to Yes. Your script will be called at the end of each hand. The parameters passed to your script are documented in the help bubble for that event, which include the hand number. Then use that to call LogsHandHistory to retrieve that hand.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: How to get a special hand data?

Postby developer » Sun Feb 08, 2015 2:47 am

Thank you ,Worked fine. It was a useful feature that there was not in API reference.
developer
 
Posts: 21
Joined: Sat Dec 13, 2014 9:27 am

Re: How to get a special hand data?

Postby Kent Briggs » Sun Feb 08, 2015 10:16 am

developer wrote:It was a useful feature that there was not in API reference.


It's in there, see the last paragraph of LogsHandHistory in the API docs.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: How to get a special hand data?

Postby developer » Sun Feb 08, 2015 1:07 pm

Yes , you right . I saw right now.
There was a line containing active players , for example : ** Hole Cards ** [2 players]
How can i parser the log two get the names of these two player?
Regards
developer
 
Posts: 21
Joined: Sat Dec 13, 2014 9:27 am

Re: How to get a special hand data?

Postby Kent Briggs » Sun Feb 08, 2015 2:24 pm

developer wrote:There was a line containing active players , for example : ** Hole Cards ** [2 players]
How can i parser the log two get the names of these two player?


If rake is enabled (ring games) they will be listed in the Rake lines. Otherwise everyone that was dealt cards will have some kind of action associated with their name including the following:

player posts big blind
player posts small blind
player posts small & big blind
player checks
player calls
player bets
player raises to
player folds
player wins
player refunded

So look for those and extract the "player" part.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Next

Return to Site Administration

Who is online

Users browsing this forum: No registered users and 2 guests

cron