Created
August 16, 2009 10:16
-
-
Save koraktor/168595 to your computer and use it in GitHub Desktop.
Generating a HTML table for player data aquired using Steam Condenser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you update this? I don't know how to code so it be a great help if you can update this.