check for invalid callback format
This commit is contained in:
parent
eee2cfd9f1
commit
72dbbbb746
@ -224,15 +224,19 @@ class StatisticCollector implements CallbackListener {
|
|||||||
break;
|
break;
|
||||||
case 'OnHit':
|
case 'OnHit':
|
||||||
$paramsObject = json_decode($callback[1][1]);
|
$paramsObject = json_decode($callback[1][1]);
|
||||||
$shooter = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Shooter->Login);
|
$weapon = (int)$paramsObject->Event->WeaponNum;
|
||||||
$victim = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Victim->Login);
|
if (isset($paramsObject->Event->Shooter)) {
|
||||||
$weapon = $paramsObject->Event->WeaponNum;
|
$shooter = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Shooter->Login);
|
||||||
if ($shooter) {
|
if ($shooter) {
|
||||||
$this->maniaControl->statisticManager->incrementStat($this->getWeaponStat(intval($weapon), false), $shooter);
|
$this->maniaControl->statisticManager->incrementStat($this->getWeaponStat($weapon, false), $shooter);
|
||||||
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_HIT, $shooter);
|
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_HIT, $shooter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($victim) {
|
if (isset($paramsObject->Event->Victim)) {
|
||||||
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_GOT_HIT, $victim);
|
$victim = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Victim->Login);
|
||||||
|
if ($victim) {
|
||||||
|
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_GOT_HIT, $victim);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'OnArmorEmpty':
|
case 'OnArmorEmpty':
|
||||||
|
Loading…
Reference in New Issue
Block a user