Request

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

Request

Postby MonTheHoops » Thu Oct 30, 2008 11:42 am

Any chance of some more samples of pages with data pulled from the api? Like how many people are currently connected, what tournaments are available, who is currently winning the tournament? Stuff like that would be great to have shown on the site, it would encourage more people to play I would hope.

I would be looking long term to add each players stats from the Poker into their vBulletin profile page, that would be a great addition.

I have so far made a page the show the chipleaders, I just need more info of how they all work and maybe I can then start using chunks from each one to create a page with all the data I need on it.

Cheers Kent, and thanks for the great work.
MonTheHoops
 
Posts: 48
Joined: Sat Jun 21, 2008 3:39 pm

Re: Request

Postby Kent Briggs » Thu Oct 30, 2008 12:55 pm

MonTheHoops wrote:Like how many people are currently connected


<?php
include "API.php";
$params = "Password=" . $pw . "&Command=ConnectionsList";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error") die("Error: " . $api["Error"]);
echo "The number of connections is " . $api["Connections"];
?>

what tournaments are available


<?php
include "API.php";
$params = "Password=" . $pw . "&Command=TournamentsList&Fields=Name,BuyIn,Status";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error") die("Error: " . $api["Error"]);
$n = $api["Tournaments"];
echo "<b>Tournaments Available</b><br>";
for($i=1;$i<=$n;$i++) echo $api["Name".$i] . " - " . $api["BuyIn".$i] . " - " . $api["Status".$i] . "<br>";
?>

who is currently winning the tournament?


<?php
include "API.php";
$tname = "Tournament #1";
$params = "Password=" . $pw . "&Command=TournamentsPlaying&Name=" . urlencode($tname);
$api = Poker_API($url,$params);
if ($api["Result"] == "Error") die("Error: " . $api["Error"]);
if (isset($api["Rank1"])) echo "Chip leader for " . $tname . " is " . $api["Player1"] . " (" . $api["Chips1"] . ")";
else echo $tname . " is not running";
?>
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3944
Joined: Wed Mar 19, 2008 8:47 pm

Re: Request

Postby Kent Briggs » Thu Oct 30, 2008 12:58 pm

FYI, the contents of API.php are listed here:

http://www.briggsoft.com/forums/viewtopic.php?f=8&t=114#p563
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3944
Joined: Wed Mar 19, 2008 8:47 pm

Re: Request

Postby MonTheHoops » Thu Oct 30, 2008 2:06 pm

Cheers Kent, I'm being greedy now, can this also list the current people connected by username?

Cheers.

:twisted:
MonTheHoops
 
Posts: 48
Joined: Sat Jun 21, 2008 3:39 pm

Re: Request

Postby Kent Briggs » Thu Oct 30, 2008 2:28 pm

MonTheHoops wrote:Cheers Kent, I'm being greedy now, can this also list the current people connected by username?


Just add a Fields=Player parameter to the ConnectionsList command as documented in the help file. Then loop through the results like was done with the tournament listing example and display $api["Player".$i]. You should check for blank values which indicate a connection made but the player not yet logged in. Something like this:

<?php
include "API.php";
$params = "Password=" . $pw . "&Command=ConnectionsList&Fields=Player";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error") die("Error: " . $api["Error"]);
$n = $api["Connections"];
echo "<b>Players Logged In</b><br>";
$logins = 0;
for($i=1;$i<=$n;$i++) if($api["Player".$i] <> "")
{
echo $api["Player".$i] . "<br>";
$logins++;
}
echo "<b>Total: </b>" . $logins;
?>
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3944
Joined: Wed Mar 19, 2008 8:47 pm

Re: Request

Postby MonTheHoops » Thu Oct 30, 2008 2:35 pm

That seems to throw up an error message of:

Error: SessionID not found

Did I miss something?
MonTheHoops
 
Posts: 48
Joined: Sat Jun 21, 2008 3:39 pm

Re: Request

Postby MonTheHoops » Thu Oct 30, 2008 2:39 pm

Ignore above, my fault.

I used ConnectionsGet instead of ConnectionsList

This is hard work, I'm no serious coder :D
MonTheHoops
 
Posts: 48
Joined: Sat Jun 21, 2008 3:39 pm

Re: Request

Postby Kent Briggs » Thu Oct 30, 2008 2:40 pm

MonTheHoops wrote:That seems to throw up an error message of:

Error: SessionID not found

Did I miss something?


Are you using ConnectionsGet instead of ConnectionsList?
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3944
Joined: Wed Mar 19, 2008 8:47 pm

Re: Request

Postby Kent Briggs » Thu Oct 30, 2008 2:41 pm

Your post beat me by 1 minute. :)
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3944
Joined: Wed Mar 19, 2008 8:47 pm

Re: Request

Postby MonTheHoops » Fri Oct 31, 2008 6:03 pm

Will the API allow access to the logfiles?

For instance is it capable of listing previous results in tournaments or ring games?

Can it show who has won the most tournaments?

Cheers Kent
MonTheHoops
 
Posts: 48
Joined: Sat Jun 21, 2008 3:39 pm

Next

Return to Site Administration

Who is online

Users browsing this forum: No registered users and 12 guests