bugfixes for game stats

This commit is contained in:
Mark Vejvoda 2013-10-31 04:00:26 +00:00
parent 42bd6b6bd3
commit 2f197aa8aa
2 changed files with 8 additions and 8 deletions

View File

@ -85,22 +85,22 @@
}
function getTimeString($frames) {
$framesleft = $frames;
$framesleft = (int)$frames;
$updateFps = 40.0;
$hours = ( int )$frames / ( float )$updateFps / 3600.0;
$hours = (int)($frames / $updateFps / 3600.0);
$framesleft = $framesleft - $hours * 3600 * $updateFps;
$minutes = ( int )$framesleft / ( float )$updateFps / 60.0;
$minutes = (int)($framesleft / $updateFps / 60.0);
$framesleft = $framesleft - $minutes * 60 * $updateFps;
$seconds = ( int )$framesleft / ( float )$updateFps;
$seconds = (int)($framesleft / $updateFps);
$hourstr = strval(( int )$hours);
$hourstr = $hours;
if($hours < 10) $hourstr = "0" . $hourstr;
$minutestr = strval(( int )$minutes);
$minutestr = $minutes;
if($minutes < 10) $minutestr = "0" . $minutestr;
$secondstr = strval(( int )$seconds);
$secondstr = $seconds;
if($seconds < 10) $secondstr = "0" . $secondstr;
return $hourstr . ":" . $minutestr . ":" . $secondstr;

View File

@ -123,7 +123,7 @@
$status_class = 'unknown';
}
if ($status_code == 3 && $server['gameUUID'] != "")
if (($status_code == 2 || $status_code == 3) && $server['gameUUID'] != "")
{
printf( "\t\t\t\t<td title=\"%s\" class=\"%s\"><a href='showGameStats.php?gameUUID=%s'>%s</a></td>%s", $server['status'], $status_class, $server['gameUUID'], htmlspecialchars( $status_title, ENT_QUOTES ), PHP_EOL );
}