Cloud Server Hosting

For general discussion of the Poker Mavens software
Post Reply
IMightBluff
Posts: 10
Joined: Sat Aug 18, 2012 6:50 pm

Cloud Server Hosting

Post by IMightBluff »

Hello,

Would I be able to host this from a cloud server?
IMightBluff
Posts: 10
Joined: Sat Aug 18, 2012 6:50 pm

Re: Cloud Server Hosting

Post by IMightBluff »

Or would these servers specs be sufficient


OS: Windows Server
2008 Standard 64-bit
• RAM: 1 GB
• Storage: 20 GB‡‡
• Bandwidth: 1,000 GB/mo
Kent Briggs
Site Admin
Posts: 5880
Joined: Wed Mar 19, 2008 8:47 pm

Re: Cloud Server Hosting

Post by Kent Briggs »

Anything running Windows will work as long as you have sufficient rights to install your own Windows programs.
mdposcom
Posts: 4
Joined: Fri Oct 12, 2012 3:40 am

Re: Cloud Server Hosting

Post by mdposcom »

I try to connect the Api from other hosting to server game but show: Error: Connection failed
Click Back Button to correct.

<?php
$url = "http://62.75.254.59:8087/api"; // <-- use your game server IP
$pw = "adminx"; // <-- use your api password

function Poker_API($url,$params,$assoc)
{
$curl = curl_init($url);
curl_setopt($curl,CURLOPT_POST,true);
curl_setopt($curl,CURLOPT_POSTFIELDS,$params);
curl_setopt($curl,CURLOPT_TIMEOUT,30);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
$response = trim(curl_exec($curl));
curl_close($curl);
$api = Array();
if ($assoc) // associative array result
{
if (empty($response))


{
$api["Result"] = "Error";
$api["Error"] = "Connection failed";
}
else
{
$paramlist = Explode("\r\n",$response);
foreach ($paramlist as $param)
{
$namevalue = Explode("=",$param,2);
$api[$namevalue[0]] = $namevalue[1];
}
}
}
else // regular array result
{
if (empty($response))
{
$api[] = "Result=Error";
$api[] = "Error=Connection failed";
}
else
{
$paramlist = Explode("\r\n",$response);
foreach ($paramlist as $param) $api[] = $param;
}
}
return $api;
}

?>
<html>
<body>

<?php

$avatarurl = "http://62.75.254.59:8087/avatar"; // set your url here
$avatarmax = 64; // number of avatars available
$avatarswf = false; // set to true if custom avatars are in swf format

include "API.php";

if (isset($_REQUEST["Submit"]))
{
$Player = $_REQUEST["Player"];
$RealName = $_REQUEST["RealName"];
$Gender = $_REQUEST["Gender"];
$Location = $_REQUEST["Location"];
$Password1 = $_REQUEST["Password1"];
$Password2 = $_REQUEST["Password2"];
$Email = $_REQUEST["Email"];
$Avatar = $_REQUEST["Avatar"];
if ($Password1 <> $Password2) die("Password mismatch. Click Back Button to correct.");
$params = "Password=$pw&Command=AccountsAdd" .
"&Player=" . urlencode($Player) .
"&RealName=" . urlencode($RealName) .
"&PW=" . urlencode($Password1) .
"&Location=" . urlencode($Location) .
"&Email=" . urlencode($Email) .
"&Avatar=" . urlencode($Avatar) .
"&Gender=" . urlencode($Gender) .
"&Chat=" . "Yes" .
"&Note=" . urlencode("Account created via API");
$api = Poker_API($url,$params,true);
if ($api["Result"] == "Ok") echo "Account successfully created for $Player";
else echo "Error: " . $api["Error"] . "<br>Click Back Button to correct.";
exit;
}
?>

<h3>Create New Account</h3>
<form method="post">
<table>
<tr><td>Your player name:</td><td><input type="text" name="Player" /></td></tr>
<tr><td>Your real name:</td><td><input type="text" name="RealName" /></td></tr>
<tr><td>Your gender:</td><td><input type="radio" name="Gender" Value="Male" checked>Male</input> &nbsp;
<input type="radio" name="Gender" Value="Female">Female</input></td></tr>
<tr><td>Your location:</td><td><input type="text" name="Location" /></td></tr>
<tr><td>Select a password:</td><td><input type="password" name="Password1" /></td></tr>
<tr><td>Confirm password:</td><td><input type="password" name="Password2" /></td></tr>
<tr><td>Your email address:</td><td><input type="text" name="Email" /></td></tr>
<tr><td>Your avatar:</td><td>
<div style="width: 100px; height: 175px; overflow: auto; border: solid 2px">
<?php
for ($i=1; $i<=$avatarmax; $i++)
{
$s = "<input type='radio' name='Avatar' value='$i'";
if ($i == 1) $s .= " checked";
$s .= ">";
if ($avatarswf)
{
$s .= "<object width='48' height='48'>" .
"<param name='movie' value='$avatarurl?Index=$i'>" .
"<embed src='$avatarurl?Index=$i' width='48' height='48' type='application/x-shockwave-flash'>" .
"</embed>" .
"</object>";
}
else $s .= "<img src='$avatarurl?Index=$i' align='middle'>";
echo $s . "<br>\r\n";
}
?>
</div>
</td></tr>
</table>
<input type="submit" name="Submit" value="Submit" />
</form>

</body>
</html>
Kent Briggs
Site Admin
Posts: 5880
Joined: Wed Mar 19, 2008 8:47 pm

Re: Cloud Server Hosting

Post by Kent Briggs »

mdposcom wrote:I try to connect the Api from other hosting to server game but show: Error: Connection failed
Click Back Button to correct.
Most likely, the host where your PHP script is located is blocking outbound connections to port 8087 so that the curl_exec() function cannot make the http connection to the poker server. You'll need to contact them and see if they will open that port in your PHP configuration. Make it clear that you trying to connect to an external server. Otherwise, if you aren't running a web server on the machine where Poker Mavens is installed, you can use 80 for the file port. It is probably not being blocked.
Post Reply