Callback Feature
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Callback Feature
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.
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.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Callback Feature
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.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..
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);
?>
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Callback Feature
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
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
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Callback Feature
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: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.
Code: Select all
http://xxx.xxx.xxx.xxx/callback.php?Password=test&Event=Login&Player=test&Time=2010-02-02 00:00:00
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Callback Feature
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
And what do I need to do to make it work as it should now?
Cheers
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Callback Feature
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.MonTheHoops wrote:Ok, that test worked and it wrote to the callback.txt file, so what does that tell us?
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Callback Feature
I lost the password to do that Kent, sorry.Kent Briggs wrote: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.MonTheHoops wrote:Ok, that test worked and it wrote to the callback.txt file, so what does that tell us?
What ports need to be open in order for that to work? 8087 and 8088?
Cheers
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Callback Feature
You just need your Directory Key. Send me an email. It's an outgoing connection so there's no ports to open.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?
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Callback Feature
ok, I'm listing on PokerMavens.net now.....
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Callback Feature
and suddenly it has all started working.......no idea how but there ya go.
Cheers Kent
Paul
Cheers Kent
Paul