added isMuted() function to the player object + some adds what a player cant do when muted (use chatmessages like /gg, add map to queue, start a vote...)

This commit is contained in:
kremsy
2014-08-24 12:28:16 +02:00
parent afa15217a2
commit ffa3506879
7 changed files with 307 additions and 263 deletions

View File

@ -317,7 +317,7 @@ class Player {
}
/**
* Sets the Player Data
* Sets the Player Data and stores it in the Database
*
* @param mixed $object
* @param string $dataName
@ -329,6 +329,21 @@ class Player {
return $this->maniaControl->getPlayerManager()->getPlayerDataManager()->setPlayerData($object, $dataName, $this, $value, $serverIndex);
}
/*
* Check if a Player is muted
*
* @return bool
*/
public function isMuted() {
$ignoreList = $this->maniaControl->getClient()->getIgnoreList(100, 0);
foreach ($ignoreList as $ignoredPlayers) {
if ($ignoredPlayers->login === $this->login) {
return true;
}
}
return false;
}
/**
* Var_Dump the Player
*/

View File

@ -516,16 +516,9 @@ class PlayerActions {
/**
* Check if a Player is muted
*
* @param string $login
* @return bool
* @deprecated see Player/isMuted()
*/
public function isPlayerMuted($login) {
$ignoreList = $this->maniaControl->getClient()->getIgnoreList(100, 0);
foreach ($ignoreList as $ignoredPlayers) {
if ($ignoredPlayers->login === $login) {
return true;
}
}
return false;
return $this->maniaControl->getPlayerManager()->getPlayer($login)->isMuted();
}
}

View File

@ -515,8 +515,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$label->setTextSize($textSize);
$label->setTextColor($textColor);
if (!$this->maniaControl->getPlayerManager()->getPlayerActions()->isPlayerMuted($login)
) {
if (!$player->isMuted()) {
$label->setText('Mute');
$quad->setAction(self::ACTION_MUTE_PLAYER . '.' . $login);
} else {