stats fixed

This commit is contained in:
kremsy 2014-01-02 15:13:59 +01:00
parent 443b42fd3c
commit 5f5514e9d3
2 changed files with 2 additions and 21 deletions

View File

@ -83,7 +83,6 @@ class StatisticCollector implements CallbackListener {
$this->onShootArray[$login] = 1;
} else {
$this->onShootArray[$login]++;
var_dump("test2");
}
//Write Shoot Data into database
@ -93,9 +92,6 @@ class StatisticCollector implements CallbackListener {
$this->maniaControl->statisticManager->insertStat(self::STAT_ON_SHOOT, $player, $serverLogin, $this->onShootArray[$login]);
$this->onShootArray[$login] = 0;
}
// var_dump($this->onShootArray);
var_dump($this->onShootArray[$login]);
}

View File

@ -110,7 +110,7 @@ class StatisticManager {
private function getStatId($statName) {
if(isset($this->stats[$statName])) {
$stat = $this->stats[$statName];
return $stat->index;
return (int)$stat->index;
} else {
return null;
}
@ -141,24 +141,9 @@ class StatisticManager {
$serverLogin = $this->maniaControl->server->getLogin();
}
// $statId = (int)$statId;
// var_dump($statId);
//var_dump($value);
var_dump($serverLogin, $player->index, $statId, $value);
$mysqli = $this->maniaControl->database->mysqli;
$testquery = "INSERT INTO `" . self::TABLE_STATISTICS . "` (
`serverLogin`,
`playerId`,
`statId`,
`value`
) VALUES (
{$serverLogin}, {$player->index}, {$statId}, {$value}
) ON DUPLICATE KEY UPDATE
`value` = `value` + VALUES(`value`);";
var_dump($testquery);
$query = "INSERT INTO `" . self::TABLE_STATISTICS . "` (
`serverLogin`,
`playerId`,