How to use TournamentsResults API call?

For discussion of the Poker Mavens server module and other administration topics
Post Reply
Grim
Posts: 87
Joined: Thu Oct 15, 2020 8:11 pm

How to use TournamentsResults API call?

Post by Grim »

I'm struggling a bit with this call when we have several of the same SNG running the same day (or any other tourney where the tournament name is the same really). I use this to send the result to everyone, once the SNG is finished.
When I fire the call with name and date, I get all the SNG tournaments (with the same name) that has run on that date. Using Start -1 doesn't change anything until I use Count. However, how do I know how many lines to pull with the Count parameter as number of participants will vary?

I'm not sure how it is intended to be used to only retrieve the last tournament with the same name. Is this even possible?
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: How to use TournamentsResults API call?

Post by Kent Briggs »

If you use the Tournament Finish callback event, it will give you a unique tournament number. With that, see this note from the help file:

Beginning with version 7.09, call with a Number parameter (indicating the tournament number) to retrieve the results of a single tournament. Leave the other parameters blank when using the Number parameter. The server caches the results of the last 100 tournaments played so the specified number must still be in the cache or an error will be returned. Use the Tournament Finish callback event to get notified when a new result (and its number) is available.
Grim
Posts: 87
Joined: Thu Oct 15, 2020 8:11 pm

Re: How to use TournamentsResults API call?

Post by Grim »

Worked like a charm, thanks!
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: How to use TournamentsResults API call?

Post by Kent Briggs »

By the way, to get the last tournament prior to 7.09 you would just read in the whole file and start from the bottom line, then read up line by line until you found a "Tournament=" line. That would be the start of the last tournament.
Grim
Posts: 87
Joined: Thu Oct 15, 2020 8:11 pm

Re: How to use TournamentsResults API call?

Post by Grim »

Well, thank God for 7.09 then. :D
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: How to use TournamentsResults API call?

Post by Kent Briggs »

Grim wrote: Fri Jan 06, 2023 11:31 pm Well, thank God for 7.09 then. :D
It was setspike's idea:

viewtopic.php?t=3811
Post Reply