resolved todo

This commit is contained in:
kremsy 2014-01-29 09:29:02 +01:00 committed by Steffen Schröder
parent a7a0aa2ee4
commit dfb792a324
3 changed files with 32 additions and 32 deletions

View File

@ -35,7 +35,7 @@ class Player {
public $downloadRate = -1; public $downloadRate = -1;
public $uploadRate = -1; public $uploadRate = -1;
public $skins = null; public $skins = null;
public $maniaPlanetPlayDays = -1; public $daysSinceZoneInscription = -1;
//Flags details //Flags details
public $forcedSpectatorState = 0; public $forcedSpectatorState = 0;
@ -80,7 +80,7 @@ class Player {
$this->ladderScore = $mpPlayer->ladderStats['PlayerRankings'][0]['Score']; $this->ladderScore = $mpPlayer->ladderStats['PlayerRankings'][0]['Score'];
$this->ladderRank = $mpPlayer->ladderStats['PlayerRankings'][0]['Ranking']; $this->ladderRank = $mpPlayer->ladderStats['PlayerRankings'][0]['Ranking'];
$this->ladderStats = $mpPlayer->ladderStats; $this->ladderStats = $mpPlayer->ladderStats;
$this->maniaPlanetPlayDays = $mpPlayer->hoursSinceZoneInscription / 24; //TODO change $this->daysSinceZoneInscription = $mpPlayer->hoursSinceZoneInscription / 24;
$this->ipAddress = $mpPlayer->iPAddress; $this->ipAddress = $mpPlayer->iPAddress;
$this->clientVersion = $mpPlayer->clientVersion; $this->clientVersion = $mpPlayer->clientVersion;
$this->downloadRate = $mpPlayer->downloadRate; $this->downloadRate = $mpPlayer->downloadRate;

View File

@ -182,7 +182,7 @@ class PlayerDetailed {
$label = clone $mainLabel; $label = clone $mainLabel;
$frame->add($label); $frame->add($label);
$label->setY($y); $label->setY($y);
$label->setText(date("d M Y", time() - 3600 * 24 * $target->maniaPlanetPlayDays)); $label->setText(date("d M Y", time() - 3600 * 24 * $target->daysSinceZoneInscription));
$quad = new Quad(); $quad = new Quad();
$frame->add($quad); $frame->add($quad);

View File

@ -10,8 +10,6 @@ use ManiaControl\Players\Player;
* *
* @author steeffeen & kremsy * @author steeffeen & kremsy
*/ */
// TODO db reference between player index and statsitics playerId
// TODO db reference between metadata statId and statistics statId
class StatisticManager { class StatisticManager {
/** /**
* Constants * Constants
@ -202,12 +200,14 @@ class StatisticManager {
foreach($this->specialStats as $stat) { foreach($this->specialStats as $stat) {
switch($stat->name) { switch($stat->name) {
case self::SPECIAL_STAT_KD_RATIO: case self::SPECIAL_STAT_KD_RATIO:
if(!isset($playerStats[StatisticCollector::STAT_ON_KILL]) || !isset($playerStats[StatisticCollector::STAT_ON_DEATH])) if (!isset($playerStats[StatisticCollector::STAT_ON_KILL]) || !isset($playerStats[StatisticCollector::STAT_ON_DEATH])) {
continue; continue;
}
$kills = intval($playerStats[StatisticCollector::STAT_ON_KILL]); $kills = intval($playerStats[StatisticCollector::STAT_ON_KILL]);
$deaths = intval($playerStats[StatisticCollector::STAT_ON_DEATH]); $deaths = intval($playerStats[StatisticCollector::STAT_ON_DEATH]);
if($deaths == 0) if ($deaths == 0) {
continue; continue;
}
$playerStats[$stat->name] = array($stat, $kills / $deaths); $playerStats[$stat->name] = array($stat, $kills / $deaths);
} }
} }