Well, the K/D returns correctly. It comes from my StdLog parser class, and I already went through the game you reported, KnacK, and the numbers appear to be correct. However, I haven't tried debugging the code that considers someone's play time.
Here's the code, albeit a little messy:
$best_play_time_per = 1;
foreach($game['players'] as $name => $info)
{
$play_time_per = $game['play_time'] ? $info['play_time']/$game['play_time'] : 0;
if($play_time_per > $best_play_time_per)
$best_play_time_per = $play_time_per;
}
// [...]
$top_k_d = array();
foreach($game['players'] as $name => $info)
{
if($info['k_d'] >= $top_kd['k_d'] && $game['play_time'] && $best_play_time_per && $info['play_time']/$game['play_time']/$best_play_time_per > .05 && $info['kills'] > 1)
{
$this->debug(sprintf("(debug) K/D= %4s %4s %s", round($info['k_d'], 2), round($info['play_time']/60, 1), DigitalPaintServer::clean_funname($name)));
$top_k_d = array('name' => DigitalPaintServer::clean_funname($name),
'k_d' => $info['k_d']);
}
// [...]
}
I have to fix a file-pointers-not-closing problem in my script before I can tackle this.