isFakePlayer
This commit is contained in:
parent
390eb7b087
commit
a2c423e7e8
@ -59,20 +59,17 @@ class Player {
|
|||||||
$this->ipAddress = $rpcInfos['IPAddress'];
|
$this->ipAddress = $rpcInfos['IPAddress'];
|
||||||
|
|
||||||
$this->joinTime = time();
|
$this->joinTime = time();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if player is not a real player
|
* Check if player is not a real player
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
// TODO: check for bot players
|
public function isFakePlayer() {
|
||||||
public function isFakePlayer() { //TODO Bot have also positive pids, so this is useless, just stringmatch *fake
|
return ($this->pid <= 0 || $this->path == "");
|
||||||
return ($this->pid <= 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,8 +129,8 @@ class PlayerManager implements CallbackListener {
|
|||||||
$player = new Player($playerInfo);
|
$player = new Player($playerInfo);
|
||||||
|
|
||||||
$this->addPlayer($player);
|
$this->addPlayer($player);
|
||||||
|
|
||||||
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_JOIN_LEAVE_MESSAGES)) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_JOIN_LEAVE_MESSAGES) && !$player->isFakePlayer()) {
|
||||||
$string = array(0 => '$0f0Player', 1 => '$0f0Moderator', 2 => '$0f0Admin', 3 => '$0f0MasterAdmin', 4 => '$0f0MasterAdmin');
|
$string = array(0 => '$0f0Player', 1 => '$0f0Moderator', 2 => '$0f0Admin', 3 => '$0f0MasterAdmin', 4 => '$0f0MasterAdmin');
|
||||||
//$nickname = Formatter::stripCodes($player->nickname); // TODO: strip codes without colour codes like in serverviewer
|
//$nickname = Formatter::stripCodes($player->nickname); // TODO: strip codes without colour codes like in serverviewer
|
||||||
|
|
||||||
@ -156,8 +156,8 @@ class PlayerManager implements CallbackListener {
|
|||||||
$login = $callback[1][0];
|
$login = $callback[1][0];
|
||||||
$player = $this->removePlayer($login);
|
$player = $this->removePlayer($login);
|
||||||
|
|
||||||
//if($player->isFakePlayer())
|
if($player->isFakePlayer())
|
||||||
//return;
|
return;
|
||||||
|
|
||||||
$played = Formatter::formatTimeH(time() - $player->joinTime);
|
$played = Formatter::formatTimeH(time() - $player->joinTime);
|
||||||
$this->maniaControl->log("Player left: " . $player->login . " / " . Formatter::stripCodes($player->nickname) . " Playtime: " . $played);
|
$this->maniaControl->log("Player left: " . $player->login . " / " . Formatter::stripCodes($player->nickname) . " Playtime: " . $played);
|
||||||
|
Loading…
Reference in New Issue
Block a user