Player Info API

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

Player Info API

Postby KillerxKen » Thu Aug 15, 2013 11:24 pm

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
KillerxKen
 
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Postby Kent Briggs » Thu Aug 15, 2013 11:56 pm

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).
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3831
Joined: Wed Mar 19, 2008 8:47 pm

Re: Player Info API

Postby KillerxKen » Fri Aug 16, 2013 12:01 am

I dont want it to display ALL the info/fields though, just those things listed, how would I do that?>
KillerxKen
 
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Postby Kent Briggs » Fri Aug 16, 2013 12:13 am

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>";
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3831
Joined: Wed Mar 19, 2008 8:47 pm

Re: Player Info API

Postby KillerxKen » Fri Aug 16, 2013 12:17 am

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

Postby KillerxKen » Fri Aug 16, 2013 12:31 am

how would I get it to remember the players name?
KillerxKen
 
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Postby Kent Briggs » Fri Aug 16, 2013 9:15 am

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.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3831
Joined: Wed Mar 19, 2008 8:47 pm

Re: Player Info API

Postby KillerxKen » Fri Aug 16, 2013 11:47 pm

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.
KillerxKen
 
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Re: Player Info API

Postby Kent Briggs » Sat Aug 17, 2013 9:08 am

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.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3831
Joined: Wed Mar 19, 2008 8:47 pm

Re: Player Info API

Postby KillerxKen » Sun Aug 18, 2013 3:46 am

I cant just have them submit their name and password to a login/form and just have it send back that info?
KillerxKen
 
Posts: 27
Joined: Mon Aug 12, 2013 7:18 pm

Next

Return to Site Administration

Who is online

Users browsing this forum: Google [Bot] and 12 guests

cron