Cashout

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

Cashout

Postby mike123 » Sat May 21, 2011 4:17 pm

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>
mike123
 
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am

Re: Cashout

Postby Kent Briggs » Sat May 21, 2011 5:53 pm

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

Re: Cashout

Postby mike123 » Sun May 22, 2011 4:37 am

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.
mike123
 
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am

Re: Cashout

Postby Kent Briggs » Sun May 22, 2011 9:24 am

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

Re: Cashout

Postby mike123 » Sun May 22, 2011 12:07 pm

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 (:
mike123
 
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am

Re: Cashout

Postby Kent Briggs » Sun May 22, 2011 1:19 pm

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

Re: Cashout

Postby mike123 » Mon May 23, 2011 4:00 am

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

Postby mike123 » Mon May 23, 2011 4:38 am

Finally it works now . :) thank you for your help kent .
mike123
 
Posts: 72
Joined: Tue Feb 16, 2010 7:30 am


Return to Site Administration

Who is online

Users browsing this forum: No registered users and 5 guests

cron