Skip to content

Instantly share code, notes, and snippets.

@koraktor
Created August 16, 2009 10:16
Show Gist options
  • Save koraktor/168595 to your computer and use it in GitHub Desktop.
Save koraktor/168595 to your computer and use it in GitHub Desktop.
Generating a HTML table for player data aquired using Steam Condenser
<?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
Copy link

Panties commented Jul 18, 2011

Yea had a feeling that would be the reason, probably should have looked into that more before signing up, oh well :(

Thanks anyway.

@NPG-Soul
Copy link

NPG-Soul commented Sep 2, 2014

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...

@jorea143
Copy link

jorea143 commented Feb 6, 2016

Could you update this? I don't know how to code so it be a great help if you can update this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment