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?
How to get a special hand data?
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to get a special 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.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?
Re: How to get a special hand data?
Well , you said
It means that in each log file is maximum 100 hands data . right?The server also holds in memory the last 100 hands played and you can retrieve a single hand from there using the Hand parameter
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to get a special hand data?
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.developer wrote:It means that in each log file is maximum 100 hands data . right?
Re: How to get a special hand data?
wooow Its what i`m looking for, how can i retrieve a hand by hand number from memory?The last 100 hands played are cached in memory and can be retrieved individually by hand number
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to get a special hand data?
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.developer wrote:wooow Its what i`m looking for, how can i retrieve a hand by hand number from memory?
Re: How to get a special hand data?
Thank you ,Worked fine. It was a useful feature that there was not in API reference.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to get a special hand data?
It's in there, see the last paragraph of LogsHandHistory in the API docs.developer wrote:It was a useful feature that there was not in API reference.
Re: How to get a special hand data?
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
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
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to get a special hand data?
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: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?
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.