Callback Feature

For general discussion of the Poker Mavens software

Callback Feature

Postby MonTheHoops » Tue Feb 02, 2010 12:25 pm

Hi Kent,

Long time no speak.

Is there any examples available for the callback feature? PHP scripts that use this feature would be great, at least a place to start anyway..

Maybe one that shows an example of each callback available, then we could build on that and see what we come up with?

Cheers

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

Re: Callback Feature

Postby Kent Briggs » Tue Feb 02, 2010 12:56 pm

MonTheHoops wrote:Is there any examples available for the callback feature? PHP scripts that use this feature would be great, at least a place to start anyway..


Here's the test PHP script (Callback.php) that I used for my own tests. It just creates/opens a local log file and appends the events to it. Note that the "TourneyStart" event will be added in the next update.

Code: Select all
<?php
  $pw = $_POST["Password"];
  if ($pw != "test") exit;
  $f = fopen("Callback.txt","a");
  $event = $_POST["Event"];
  switch ($event)
  {
    case "Login":
      fwrite($f,"Event = " . $event . "\n");
      fwrite($f,"Player = " . $_POST["Player"] . "\n");
      fwrite($f,"Time = " . $_POST["Time"] . "\n");
      fwrite($f,"\n");
      break;
    case "Logout":
      fwrite($f,"Event = " . $event . "\n");
      fwrite($f,"Player = " . $_POST["Player"] . "\n");
      fwrite($f,"Time = " . $_POST["Time"] . "\n");
      fwrite($f,"\n");
      break;
    case "TourneyStart":
      fwrite($f,"Event = " . $event . "\n");
      fwrite($f,"Name = " . $_POST["Name"] . "\n");
      fwrite($f,"Time = " . $_POST["Time"] . "\n");
      fwrite($f,"\n");
      break;
    case "TourneyFinish":
      fwrite($f,"Event = " . $event . "\n");
      fwrite($f,"Name = " . $_POST["Name"] . "\n");
      fwrite($f,"Time = " . $_POST["Time"] . "\n");
      fwrite($f,"\n");
      break;
    case "RingGameError":
      fwrite($f,"Event = " . $event . "\n");
      fwrite($f,"Name = " . $_POST["Name"] . "\n");
      fwrite($f,"Error = " . $_POST["Error"] . "\n");
      fwrite($f,"Time = " . $_POST["Time"] . "\n");
      fwrite($f,"\n");
      break;
    case "TourneyError":
      fwrite($f,"Event = " . $event . "\n");
      fwrite($f,"Name = " . $_POST["Name"] . "\n");
      fwrite($f,"Error = " . $_POST["Error"] . "\n");
      fwrite($f,"Time = " . $_POST["Time"] . "\n");
      fwrite($f,"\n");
      break;
    default:
      fwrite($f,"Unknown event: " . $event . "\n");
      fwrite($f,"\n");
      break;
  }
  fclose($f);
?>
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: Callback Feature

Postby MonTheHoops » Tue Feb 02, 2010 1:53 pm

Thanks Kent,

Just tried it but no joy at the moment, I'll try again later.

I uploaded a file containing the info above and called it callback.php, I set up the server to enable callbacks to the URL including that file, checked file permissions but nothing wrote to callback.txt when I log in.

Any more pointers?

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

Re: Callback Feature

Postby Kent Briggs » Tue Feb 02, 2010 2:05 pm

MonTheHoops wrote:I uploaded a file containing the info above and called it callback.php, I set up the server to enable callbacks to the URL including that file, checked file permissions but nothing wrote to callback.txt when I log in.


Did you set the password to "test" or fix that line to match yours? If you change all the $_POST commands to $_REQUEST, you could test it with your browser by including the parameters in the URL. Something like:

Code: Select all
http://xxx.xxx.xxx.xxx/callback.php?Password=test&Event=Login&Player=test&Time=2010-02-02 00:00:00


Also if your PHP script is on a Linux system, remember that file names are case sensitive so Callback.php <> callback.php
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: Callback Feature

Postby MonTheHoops » Tue Feb 02, 2010 4:45 pm

Ok, that test worked and it wrote to the callback.txt file, so what does that tell us?

And what do I need to do to make it work as it should now?

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

Re: Callback Feature

Postby Kent Briggs » Tue Feb 02, 2010 5:00 pm

MonTheHoops wrote:Ok, that test worked and it wrote to the callback.txt file, so what does that tell us?


Can you get your site to list at http://www.pokermavens.net ? The server makes an HTTP call to do that so it should tell you if there's a firewall issue or not.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: Callback Feature

Postby MonTheHoops » Tue Feb 02, 2010 5:14 pm

Kent Briggs wrote:
MonTheHoops wrote:Ok, that test worked and it wrote to the callback.txt file, so what does that tell us?


Can you get your site to list at http://www.pokermavens.net ? The server makes an HTTP call to do that so it should tell you if there's a firewall issue or not.
I lost the password to do that Kent, sorry.

What ports need to be open in order for that to work? 8087 and 8088?

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

Re: Callback Feature

Postby Kent Briggs » Tue Feb 02, 2010 5:31 pm

MonTheHoops wrote:I lost the password to do that Kent, sorry.
What ports need to be open in order for that to work? 8087 and 8088?


You just need your Directory Key. Send me an email. It's an outgoing connection so there's no ports to open.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3806
Joined: Wed Mar 19, 2008 8:47 pm

Re: Callback Feature

Postby MonTheHoops » Wed Feb 03, 2010 6:06 am

ok, I'm listing on PokerMavens.net now.....
MonTheHoops
 
Posts: 48
Joined: Sat Jun 21, 2008 3:39 pm

Re: Callback Feature

Postby MonTheHoops » Wed Feb 03, 2010 7:03 am

and suddenly it has all started working.......no idea how but there ya go.

Cheers Kent

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


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron