stats fixed
This commit is contained in:
parent
443b42fd3c
commit
5f5514e9d3
@ -83,7 +83,6 @@ class StatisticCollector implements CallbackListener {
|
|||||||
$this->onShootArray[$login] = 1;
|
$this->onShootArray[$login] = 1;
|
||||||
} else {
|
} else {
|
||||||
$this->onShootArray[$login]++;
|
$this->onShootArray[$login]++;
|
||||||
var_dump("test2");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Write Shoot Data into database
|
//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->maniaControl->statisticManager->insertStat(self::STAT_ON_SHOOT, $player, $serverLogin, $this->onShootArray[$login]);
|
||||||
$this->onShootArray[$login] = 0;
|
$this->onShootArray[$login] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// var_dump($this->onShootArray);
|
|
||||||
var_dump($this->onShootArray[$login]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ class StatisticManager {
|
|||||||
private function getStatId($statName) {
|
private function getStatId($statName) {
|
||||||
if(isset($this->stats[$statName])) {
|
if(isset($this->stats[$statName])) {
|
||||||
$stat = $this->stats[$statName];
|
$stat = $this->stats[$statName];
|
||||||
return $stat->index;
|
return (int)$stat->index;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -141,24 +141,9 @@ class StatisticManager {
|
|||||||
$serverLogin = $this->maniaControl->server->getLogin();
|
$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;
|
$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 . "` (
|
$query = "INSERT INTO `" . self::TABLE_STATISTICS . "` (
|
||||||
`serverLogin`,
|
`serverLogin`,
|
||||||
`playerId`,
|
`playerId`,
|
||||||
|
Loading…
Reference in New Issue
Block a user