Having some trouble with this, i can't seem to connect to other servers either, such as CS:S.
<a href="http://www.game-monitor.com/cstrike2_GameServer/64.94.238.36:27015/TGTrue_Grit_Monster_Server_No_AWPAuto.html" target="_blank">Server to Connect</a>
Have been trying to connect to this server with IP: 64.94.238.36 and Port: 27016.
I'm also using this <a href="https://github.com/xPaw/PHP-Source-Query-Class" target="_blank">Library</a>.
Sorry if this might seem off-topic, though it's for the NS2 community -secret- .
I did manage to take a look at the library you mentioned basti, though from what i can gather. The one you mentioned is very similar to the one i'm currently using. Though that library has more server connections, when i only need source.
I don't know the library you're using, but the server you want to query does not respond. So I don't know if there is a problem with the server, the library you are using or your script... I've created an example for you with the steam-condenser library in PHP:
<!--quoteo(post=1888651:date=Dec 5 2011, 08:35 PM:name=basti1337)--><div class='quotetop'>QUOTE (basti1337 @ Dec 5 2011, 08:35 PM) <a href="index.php?act=findpost&pid=1888651"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I don't know the library you're using, but the server you want to query does not respond. So I don't know if there is a problem with the server, the library you are using or your script... I've created an example for you with the steam-condenser library in PHP:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->64.94.238.36:27015 [TG]True Grit Monster Server [No AWP/Auto]<!--c2--></div><!--ec2-->
Appears to work properly, but it does respond with quite a latency (about 2 seconds worth), so that may screw up your script a bit. You can try that NS2-server basti1337 mentioned (95.156.232.240:27016), it should respond immidiately.
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Helpdesk Problem using fsockopen function
Why am I unable to use the fsockopen function?
The fsockopen function will work for outbound connection to any URL on port 80 (HTTP) or 443 (HTTPS). If fsockopen is attempting to use another port, it will not work until we have added that port to the firewall.
By default, your account is on a shared IP address. We have a firewall for our shared IP customers which prohibits opening additional ports. If you need to connect using a port number other than 80 or 443, this will require you Purchase a Dedicated IP for your Bluehost account.
Dedicated IPs cost $2.50 per month, the equivalent of $30 per year (prorated to the remaining hosting term). You may purchase a Dedicated IP address from within your cPanel by clicking on the Dedicated IP tab at the top of the page.
Once you have a dedicated IP, you will need to contact us via Phone, Live Chat or by Opening a Ticket to request the specific port number is added to the firewall.
Note: While we can can generally open any port over 1024, ports 1024 and lower are restricted and cannot be opened.<!--QuoteEnd--></div><!--QuoteEEnd-->
Comments
I'm looking for something php compatible.
I've discovered this: <a href="https://developer.valvesoftware.com/wiki/Server_Queries" target="_blank">https://developer.valvesoftware.com/wiki/Server_Queries</a>
Though this does not actually work for ns2 servers. Unless i'm using the wrong port.
Cheers,
-Scott.C
<a href="https://github.com/koraktor/steam-condenser" target="_blank">https://github.com/koraktor/steam-condenser</a>
Oh and you need to query 1 port above the connect-port (instead of the connect-port directly as with Source-games). This is usually 27016 (27015 + 1).
Having some trouble with this, i can't seem to connect to other servers either, such as CS:S.
<a href="http://www.game-monitor.com/cstrike2_GameServer/64.94.238.36:27015/TGTrue_Grit_Monster_Server_No_AWPAuto.html" target="_blank">Server to Connect</a>
Have been trying to connect to this server with IP: 64.94.238.36 and Port: 27016.
I'm also using this <a href="https://github.com/xPaw/PHP-Source-Query-Class" target="_blank">Library</a>.
Sorry if this might seem off-topic, though it's for the NS2 community -secret- .
I did manage to take a look at the library you mentioned basti, though from what i can gather. The one you mentioned is very similar to the one i'm currently using. Though that library has more server connections, when i only need source.
Cheers,
-Scott.C
I've created an example for you with the steam-condenser library in PHP:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php
error_reporting( E_ALL & ~E_USER_NOTICE );
require "./steam-condenser.php";
try {
// HBZ Server
$conn = new SourceServer( "95.156.232.240", 27016 );
$ping = $conn->getPing();
$serverinfo = $conn->getServerInfo();
$players = $conn->getPlayers();
var_dump( "Ping", $ping, "Serverinfo", $serverinfo, "Players", $players );
} catch ( SteamCondenserException $e ) {
var_dump( "Exception", $e );
}
?><!--c2--></div><!--ec2-->
I've already tried 27015, though when you mentioned (IP + 1) I assumed it was for all servers.
This is what i'm doing.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php
require 'SourceQuery.class.php';
$Query = new SourceQuery( );
try
{
$Query->Connect( '64.94.238.36', 27015 );
print_r("Info:".$Query->GetInfo( ) );
print_r( $Query->GetPlayers( ) );
print_r( $Query->GetRules( ) );
$Query->Disconnect( );
}
catch( SQueryException $e )
{
$Query->Disconnect( );
echo "Error: " . $e->getMessage( );
}
?><!--c2--></div><!--ec2-->
Cheers,
-Scott.C
I've created an example for you with the steam-condenser library in PHP:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php
error_reporting( E_ALL & ~E_USER_NOTICE );
require "./steam-condenser.php";
try {
// HBZ Server
$conn = new SourceServer( "95.156.232.240", 27016 );
$ping = $conn->getPing();
$serverinfo = $conn->getServerInfo();
$players = $conn->getPlayers();
var_dump( "Ping", $ping, "Serverinfo", $serverinfo, "Players", $players );
} catch ( SteamCondenserException $e ) {
var_dump( "Exception", $e );
}
?><!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd-->
Will give this a go and let you know how it turns out.
Cheers,
-Scott.C
Appears to work properly, but it does respond with quite a latency (about 2 seconds worth), so that may screw up your script a bit. You can try that NS2-server basti1337 mentioned (95.156.232.240:27016), it should respond immidiately.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->95.156.232.240:27016 Heidis Ziegenfarm 1 (HBZ)<!--c2--></div><!--ec2-->
Problem using fsockopen function
Why am I unable to use the fsockopen function?
The fsockopen function will work for outbound connection to any URL on port 80 (HTTP) or 443 (HTTPS). If fsockopen is attempting to use another port, it will not work until we have added that port to the firewall.
By default, your account is on a shared IP address. We have a firewall for our shared IP customers which prohibits opening additional ports. If you need to connect using a port number other than 80 or 443, this will require you Purchase a Dedicated IP for your Bluehost account.
Dedicated IPs cost $2.50 per month, the equivalent of $30 per year (prorated to the remaining hosting term). You may purchase a Dedicated IP address from within your cPanel by clicking on the Dedicated IP tab at the top of the page.
Once you have a dedicated IP, you will need to contact us via Phone, Live Chat or by Opening a Ticket to request the specific port number is added to the firewall.
Note: While we can can generally open any port over 1024, ports 1024 and lower are restricted and cannot be opened.<!--QuoteEnd--></div><!--QuoteEEnd-->
Be right back, gotta make a phone call.
Thanks for your help, everything is running smoothly now.
Once i rang up my website provider and forwarded the port, everything works.
Cheers for the help,
-Scott.C