Cashout

For discussion of the Poker Mavens server module and other administration topics
Post Reply
mike123
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am

Cashout

Post by mike123 »

Hello, used the default form for decrement..
here the administrator decrement the users chips and save a log on a database..
but i need the player to write his password in the form or the code stop. any help ?


$curl_connection = curl_init('http://localhost:8087/api');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
$post_data['Command'] = 'AccountsDecBalance';
$post_data['Player'] = "$user";
$post_data['Amount'] = "$chips";
$post_data['Password'] = 'apipass';
foreach ( $post_data as $key => $value)
{
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);
curl_close($curl_connection);

echo "$chips chips has been cashed out from $user <br> <a href=menu.php >Main Menu</a>";
?></center>
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Cashout

Post by Kent Briggs »

mike123 wrote:Hello, used the default form for decrement..
here the administrator decrement the users chips and save a log on a database..
but i need the player to write his password in the form or the code stop. any help ?
I'm not sure I understand the question. It sounds like you want a player to request a cashout (and prove their identity) and then have a separate administrator run code that decrements that balance? If that's correct, you could write a separate program that puts up an html form for the player where they enter their name, password, amount. Process that with PHP so that it confirms the password (using the AccountsGet API) and then logs that request into some kind of database and possibly sends an email to the admin. The admin then comes along later and runs code that scans the database for pending requests and then processes them.
mike123
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am

Re: Cashout

Post by mike123 »

u didnt understand me :P my english is bad. well just a simple question...

i want the api to verify a players password if its true in the poker mavens

for example..

lets say a form

player : mike
password : 123

the api go to mike. and check if the passwrod is 123. if yes continue if no die and echo wrong pass.. thats it.. thank you.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Cashout

Post by Kent Briggs »

mike123 wrote: i want the api to verify a players password if its true in the poker mavens
Just call AccountsGet in the API with a Player parameter set to the player's name and then compare $api["PW"] with the Password that the user entered on the form.

if ($api["PW"] <> $Password) die("Password is incorrect");
mike123
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am

Re: Cashout

Post by mike123 »

sorry for disturbing , my programmer is absent and i wanna do it myself.

just one question.

lets say in the pm server... there's the player tony

i want to echo that player's pass...

<?php

include "API.php";

$tonypass=?????? ;

echo "$tonypass";

?>

just this one will solve it . . . thank you again kent (:
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Cashout

Post by Kent Briggs »

mike123 wrote:sorry for disturbing , my programmer is absent and i wanna do it myself.
just one question.
lets say in the pm server... there's the player tony
i want to echo that player's pass...
To make an API call, you've got to do all the curl parameter setup like you showed in your original message. Except instead of using the AccountsDecBalance command, you will use AccountsGet. Check the API docs in the help file for all the results returned by AccountsGet.
mike123
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am

Re: Cashout

Post by mike123 »

Still not workin


<?php
include "API.php";
$curl_connection = curl_init('http://localhost:8087/api');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
$post_data['Command'] = 'AccountsGet';
$post_data['Player'] = "mix";
$post_data['Password'] = 'apipass';
foreach ( $post_data as $key => $value)
{
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);
curl_close($curl_connection);
echo $api["PW"];

?>
mike123
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am

Re: Cashout

Post by mike123 »

Finally it works now . :) thank you for your help kent .
Post Reply