bug fixes
This commit is contained in:
parent
7bf223cd45
commit
b66603a8f7
@ -117,17 +117,17 @@ class PlayerManager implements CallbackListener {
|
|||||||
if($playerItem->playerId <= 0) {
|
if($playerItem->playerId <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$playerInfo = $this->maniaControl->client->getPlayerInfo($playerItem->login);
|
$playerInfo = $this->maniaControl->client->getPlayerInfo($playerItem->login);
|
||||||
|
|
||||||
//TODO just a workaround due nadeos bad structure
|
//TODO just a workaround due nadeos bad structure
|
||||||
$detailedPlayerInfo = $this->maniaControl->client->getDetailedPlayerInfo($playerItem->login);
|
$detailedPlayerInfo = $this->maniaControl->client->getDetailedPlayerInfo($playerItem->login);
|
||||||
$playerInfo->path = $detailedPlayerInfo->path;
|
$playerInfo->path = $detailedPlayerInfo->path;
|
||||||
$playerInfo->language = $detailedPlayerInfo->language;
|
$playerInfo->language = $detailedPlayerInfo->language;
|
||||||
$playerInfo->clientVersion = $detailedPlayerInfo->clientVersion;
|
$playerInfo->clientVersion = $detailedPlayerInfo->clientVersion;
|
||||||
$playerInfo->iPAddress = $detailedPlayerInfo->iPAddress;
|
$playerInfo->iPAddress = $detailedPlayerInfo->iPAddress;
|
||||||
$playerInfo->isSpectator = $detailedPlayerInfo->isSpectator;
|
$playerInfo->isSpectator = $detailedPlayerInfo->isSpectator;
|
||||||
$playerInfo->avatar = $detailedPlayerInfo->avatar;
|
$playerInfo->avatar = $detailedPlayerInfo->avatar;
|
||||||
$playerInfo->ladderStats = $detailedPlayerInfo->ladderStats;
|
$playerInfo->ladderStats = $detailedPlayerInfo->ladderStats;
|
||||||
|
|
||||||
$player = new Player($playerInfo);
|
$player = new Player($playerInfo);
|
||||||
$player->hasJoinedGame = true;
|
$player->hasJoinedGame = true;
|
||||||
@ -187,8 +187,8 @@ class PlayerManager implements CallbackListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$player->teamId = $callback[1][0]["TeamId"];
|
$player->teamId = $callback[1][0]["TeamId"];
|
||||||
$player->ladderRank = $callback[1][0]["LadderRanking"];
|
$player->ladderRank = $callback[1][0]["LadderRanking"];
|
||||||
|
|
||||||
$prevJoinState = $player->hasJoinedGame;
|
$prevJoinState = $player->hasJoinedGame;
|
||||||
|
|
||||||
@ -207,6 +207,9 @@ class PlayerManager implements CallbackListener {
|
|||||||
$logMessage = "Player joined: {$player->login} / " . Formatter::stripCodes($player->nickname) . " Nation: " . $player->getCountry() . " IP: {$player->ipAddress}";
|
$logMessage = "Player joined: {$player->login} / " . Formatter::stripCodes($player->nickname) . " Nation: " . $player->getCountry() . " IP: {$player->ipAddress}";
|
||||||
$this->maniaControl->log($logMessage);
|
$this->maniaControl->log($logMessage);
|
||||||
|
|
||||||
|
// Increment the Player Join Count
|
||||||
|
$this->maniaControl->statisticManager->incrementStat(self::STAT_JOIN_COUNT, $player, $this->maniaControl->server->index);
|
||||||
|
|
||||||
// Trigger own PlayerJoined callback
|
// Trigger own PlayerJoined callback
|
||||||
$this->maniaControl->callbackManager->triggerCallback(self::CB_PLAYERJOINED, array(self::CB_PLAYERJOINED, $player));
|
$this->maniaControl->callbackManager->triggerCallback(self::CB_PLAYERJOINED, array(self::CB_PLAYERJOINED, $player));
|
||||||
}
|
}
|
||||||
@ -377,9 +380,6 @@ class PlayerManager implements CallbackListener {
|
|||||||
$playerStatement->free_result();
|
$playerStatement->free_result();
|
||||||
$playerStatement->close();
|
$playerStatement->close();
|
||||||
|
|
||||||
// Increment the Player Join Count
|
|
||||||
$this->maniaControl->statisticManager->incrementStat(self::STAT_JOIN_COUNT, $player, $this->maniaControl->server->index);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,8 +177,6 @@ class StatisticCollector implements CallbackListener {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -224,13 +222,13 @@ class StatisticCollector implements CallbackListener {
|
|||||||
|
|
||||||
switch($callbackName) {
|
switch($callbackName) {
|
||||||
case 'LibXmlRpc_OnShoot':
|
case 'LibXmlRpc_OnShoot':
|
||||||
$this->handleOnShoot($callback[1][1][0], $callback[1][1][1]);
|
$this->handleOnShoot($callback[1][1][0], $callback[1][1][3]);
|
||||||
break;
|
break;
|
||||||
case 'LibXmlRpc_OnHit':
|
case 'LibXmlRpc_OnHit':
|
||||||
$shooter = $this->maniaControl->playerManager->getPlayer($callback[1][1][0]);
|
$shooter = $this->maniaControl->playerManager->getPlayer($callback[1][1][0]);
|
||||||
$victim = $this->maniaControl->playerManager->getPlayer($callback[1][1][1]);
|
$victim = $this->maniaControl->playerManager->getPlayer($callback[1][1][1]);
|
||||||
$weapon = $this->maniaControl->playerManager->getPlayer($callback[1][1][3]);
|
$weapon = $callback[1][1][3];
|
||||||
$this->maniaControl->statisticManager->incrementStat($this->getWeaponStat($weapon, false), $shooter);
|
$this->maniaControl->statisticManager->incrementStat($this->getWeaponStat(intval($weapon), false), $shooter);
|
||||||
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_HIT, $shooter);
|
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_HIT, $shooter);
|
||||||
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_GOT_HIT, $victim);
|
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_GOT_HIT, $victim);
|
||||||
break;
|
break;
|
||||||
@ -279,7 +277,7 @@ class StatisticCollector implements CallbackListener {
|
|||||||
$paramsObject = json_decode($callback[1][1]);
|
$paramsObject = json_decode($callback[1][1]);
|
||||||
$shooter = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Shooter->Login);
|
$shooter = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Shooter->Login);
|
||||||
$victim = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Victim->Login);
|
$victim = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->Victim->Login);
|
||||||
$weapon = $this->maniaControl->playerManager->getPlayer($paramsObject->Event->WeaponNum);
|
$weapon = $paramsObject->Event->WeaponNum;
|
||||||
$this->maniaControl->statisticManager->incrementStat($this->getWeaponStat($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);
|
||||||
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_GOT_HIT, $victim);
|
$this->maniaControl->statisticManager->incrementStat(self::STAT_ON_GOT_HIT, $victim);
|
||||||
|
Loading…
Reference in New Issue
Block a user