Support for master game ID.

This commit is contained in:
Matthew Bowra-Dean
2010-05-28 23:22:08 +12:00
parent 1839655eb5
commit fd014e15a5
9 changed files with 31 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
<?php
$post_file = fopen("php://input", "rb");
$log_file = fopen("log.".time().".gz", "wb");
$post_file = fopen('php://input', 'rb');
$log_file = fopen('log.'.time().'.gz', 'wb');
$post_data = '';
while (!feof($post_file)) {
@@ -11,4 +11,9 @@ fwrite($log_file, $post_data);
fclose($post_file);
fclose($log_file);
foreach ($_SERVER as $key=>$value)
{
echo $key.': '.$value.'\n';
}
?>

View File

@@ -6,9 +6,11 @@
$db = new PDO('sqlite:openra.db');
$stale = 60 * 5;
$result = $db->query('SELECT * FROM servers WHERE (' . time() . ' - ts < ' . $stale . ')');
$n = 0;
foreach ( $result as $row )
{
echo "Game@" . $row['id'] . ":\n";
echo "Game@" . $n++ . ":\n";
echo "\tId: " . $row['id'] . "\n";
echo "\tName: " . $row['name'] . "\n";
echo "\tAddress: " . $row['address'] . "\n";
echo "\tState: " . $row['state'] . "\n";