Player Info API

For discussion of the Poker Mavens server module and other administration topics
KillerxKen
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Player Info API

Post by KillerxKen »

I was wondering if anyone knew: what would be the correct PHP to display players their basic info such as Username,total balance,chips in play(tourn and ring), and email. I would like to have it where this page is displayed right after one logs in, ala sealwithclubs. So I also need to figure out how to get the page to remember username with fetch command, so when the page loads it loads only the logged in players info ever. thanks for any advice

Ken
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Player Info API

Post by Kent Briggs »

KillerxKen wrote:I was wondering if anyone knew: what would be the correct PHP to display players their basic info such as Username,total balance,chips in play(tourn and ring), and email.
AccountsGet is the API command for that, or at least everything except tournament chips (which have no relation to a player's chip balance).
KillerxKen
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Post by KillerxKen »

I dont want it to display ALL the info/fields though, just those things listed, how would I do that?>
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Player Info API

Post by Kent Briggs »

KillerxKen wrote:I dont want it to display ALL the info/fields though, just those things listed, how would I do that?>
AccountsGet reports about 2 dozen fields but you would just grab the ones you care about and ignore the rest. For example, something like this (untested):

Code: Select all

include "API.php";
$player = "player_name_here";
$params = "Command=AccountsGet&Password=$pw&Player=$player";
$api = Poker_API($url, $params, true);
if ($api["Result"] != "Ok") die($api["Error"]);
echo "Chip balance for $player is " . $api["Balance"] . "<br>";
echo "Email for $player is " . $api["Email"] . "<br>";
KillerxKen
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Post by KillerxKen »

thats what i was missing, thanks so much Mr. Briggs, and continued best of luck with this great product.
KillerxKen
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Post by KillerxKen »

how would I get it to remember the players name?
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Player Info API

Post by Kent Briggs »

KillerxKen wrote:how would I get it to remember the players name?
Depends on what "it" is. In what context is your code being used? If the player is logging into your web site, they would be entering their own name into a form input. Or it's fetched from a cookie that you set. If you are running stats for every player you can fetch the whole list the AccountsList command in the API. Otherwise you could be saving and retrieving names from your own database.
KillerxKen
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Post by KillerxKen »

meaning when i have them login(to my webpage, not the software)and they are then sent to a page we will call "playerinfo.php" . I want the AP to remember atleast their username if not also the password, so the page displays the information we want.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Player Info API

Post by Kent Briggs »

KillerxKen wrote:meaning when i have them login(to my webpage, not the software)and they are then sent to a page we will call "playerinfo.php" . I want the AP to remember atleast their username if not also the password, so the page displays the information we want.
That's typically done with a cookie on your login page. Then you would pass that to your php script via POST parameter.
KillerxKen
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Post by KillerxKen »

I cant just have them submit their name and password to a login/form and just have it send back that info?
Post Reply