-
-
Save koraktor/168595 to your computer and use it in GitHub Desktop.
<?php | |
// Be sure that the path is correct | |
require_once "/path/to/steam-condenser/lib/steam-condenser.php"; | |
// Add your server's IP address here ... | |
$ipAddress = new InetAddress("x.x.x.x"); | |
// ... and port number here | |
$portNumber = yyyyy; | |
$server = new GoldSrcServer($ipAddress, $portNumber); | |
$players = $server->getPlayers("passw0rd"); // Player pings are only available if the RCON password is provided | |
echo "<table>"; | |
echo "<tr><th>Name</th><th>Score</th><th>Ping</th></tr>"; | |
foreach($players as $player) { | |
echo "<tr>"; | |
echo "<td>{$player->getName()}</td>"; | |
echo "<td>{$player->getScore()}</td>"; | |
echo "<td>{$player->getPing()}</td>"; | |
echo "</tr>"; | |
} | |
echo "</table>"; | |
?> |
@Panties: My guess is that you're probably running your code in an restricted environment (like a shared PHP host) that doesn't allow you to open socket connections. That is a common restriction on standard web hosts. So you're probably unable to use Steam Condenser on your current web host.
PS: The right syntax for code blocks here on GitHub is '''php
and '''
, but with backticks instead of single quotes. I updated your post above so you may see how I used it there.
Yea had a feeling that would be the reason, probably should have looked into that more before signing up, oh well :(
Thanks anyway.
koraktor, could you add the ability to specify a secondary port for games that have a seperate port for rcon purposes such as Arma2. It does not use the steamquery port but the gameport wich is different then the steamqueryport, effectivly making it impossible to use the rcon for arma2 bases servers atm with this library...
Could you update this? I don't know how to code so it be a great help if you can update this.
Hey, I'm also running into some trouble with this script, I'm getting these errors
and the code I'm using
I have no idea what codes to use and < code> didnt work, sorry
The IP and Port are definitely correct, the path to steam-condenser is correct also. I've removed the echo'ing for simplicity's sake, sorry for the messyness
Thanks