2013-11-09 20:18:49 +01:00
|
|
|
<?php
|
|
|
|
|
2013-11-12 15:48:25 +01:00
|
|
|
namespace ManiaControl\Players;
|
2014-01-01 18:53:19 +01:00
|
|
|
|
2017-05-15 21:08:52 +02:00
|
|
|
use ManiaControl\Admin\AuthenticationManager;
|
2017-03-24 22:08:51 +01:00
|
|
|
use ManiaControl\General\Dumpable;
|
|
|
|
use ManiaControl\General\DumpTrait;
|
2017-03-26 19:44:55 +02:00
|
|
|
use ManiaControl\General\UsageInformationAble;
|
|
|
|
use ManiaControl\General\UsageInformationTrait;
|
2014-05-13 16:40:05 +02:00
|
|
|
use ManiaControl\ManiaControl;
|
2014-05-13 16:15:46 +02:00
|
|
|
use ManiaControl\Utils\ClassUtil;
|
2014-05-13 14:32:30 +02:00
|
|
|
use ManiaControl\Utils\Formatter;
|
2015-07-25 12:18:39 +02:00
|
|
|
use Maniaplanet\DedicatedServer\Structures\LadderStats;
|
2013-11-09 20:18:49 +01:00
|
|
|
|
2013-11-10 02:55:08 +01:00
|
|
|
/**
|
2014-01-01 18:53:19 +01:00
|
|
|
* Player Model Class
|
2013-11-10 02:55:08 +01:00
|
|
|
*
|
2014-05-02 17:50:30 +02:00
|
|
|
* @author ManiaControl Team <mail@maniacontrol.com>
|
2020-01-22 10:39:35 +01:00
|
|
|
* @copyright 2014-2020 ManiaControl Team
|
2014-05-02 17:50:30 +02:00
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
2013-11-10 02:55:08 +01:00
|
|
|
*/
|
2017-03-26 19:44:55 +02:00
|
|
|
class Player implements Dumpable, UsageInformationAble {
|
|
|
|
use DumpTrait, UsageInformationTrait;
|
2017-03-24 22:08:51 +01:00
|
|
|
|
2014-04-12 12:14:37 +02:00
|
|
|
/*
|
|
|
|
* Public Properties
|
2013-11-10 02:55:08 +01:00
|
|
|
*/
|
2015-07-25 12:18:39 +02:00
|
|
|
public $index = -1;
|
|
|
|
public $pid = -1;
|
|
|
|
public $login = null;
|
|
|
|
public $nickname = null;
|
2014-05-15 15:13:18 +02:00
|
|
|
public $rawNickname = null;
|
2015-07-25 12:18:39 +02:00
|
|
|
public $path = null;
|
|
|
|
public $authLevel = 0;
|
|
|
|
public $language = null;
|
|
|
|
public $avatar = null;
|
|
|
|
public $allies = array();
|
|
|
|
public $clubLink = null;
|
|
|
|
public $teamId = -1;
|
|
|
|
public $isOfficial = null;
|
2013-11-10 17:23:00 +01:00
|
|
|
public $ladderScore = -1.;
|
2015-07-25 12:18:39 +02:00
|
|
|
public $ladderRank = -1;
|
|
|
|
/** @var LadderStats $ladderStats */
|
|
|
|
public $ladderStats = null;
|
|
|
|
public $joinTime = -1;
|
|
|
|
public $ipAddress = null;
|
|
|
|
public $isConnected = true;
|
|
|
|
public $clientVersion = null;
|
|
|
|
public $downloadRate = -1;
|
|
|
|
public $uploadRate = -1;
|
|
|
|
public $skins = null;
|
2014-01-29 09:29:02 +01:00
|
|
|
public $daysSinceZoneInscription = -1;
|
2014-01-23 16:15:41 +01:00
|
|
|
|
|
|
|
//Flags details
|
2015-07-25 12:18:39 +02:00
|
|
|
public $forcedSpectatorState = 0;
|
|
|
|
public $isReferee = false;
|
|
|
|
public $isPodiumReady = false;
|
|
|
|
public $isUsingStereoscopy = false;
|
2014-01-23 16:15:41 +01:00
|
|
|
public $isManagedByAnOtherServer = false;
|
2015-07-25 12:18:39 +02:00
|
|
|
public $isServer = false;
|
|
|
|
public $hasPlayerSlot = false;
|
|
|
|
public $isBroadcasting = false;
|
|
|
|
public $hasJoinedGame = false;
|
2014-01-23 16:15:41 +01:00
|
|
|
|
|
|
|
//SpectatorStatus details
|
2015-07-25 12:18:39 +02:00
|
|
|
public $isSpectator = false;
|
2014-01-23 16:15:41 +01:00
|
|
|
public $isTemporarySpectator = false;
|
2015-07-25 12:18:39 +02:00
|
|
|
public $isPureSpectator = false;
|
|
|
|
public $autoTarget = false;
|
|
|
|
public $currentTargetId = 0;
|
2014-01-23 16:15:41 +01:00
|
|
|
|
2014-05-09 17:30:43 +02:00
|
|
|
/*
|
2014-08-02 22:31:46 +02:00
|
|
|
* Private properties
|
2014-05-09 17:30:43 +02:00
|
|
|
*/
|
2014-08-02 22:31:46 +02:00
|
|
|
/** @var ManiaControl $maniaControl */
|
2014-05-09 17:30:43 +02:00
|
|
|
private $maniaControl = null;
|
2015-07-25 12:18:39 +02:00
|
|
|
private $cache = array();
|
2014-05-09 17:30:43 +02:00
|
|
|
|
2013-11-10 02:55:08 +01:00
|
|
|
/**
|
2014-05-09 17:30:43 +02:00
|
|
|
* Construct a new Player
|
|
|
|
*
|
|
|
|
* @param ManiaControl $maniaControl
|
2014-05-09 18:42:17 +02:00
|
|
|
* @param bool $connected
|
2013-11-10 02:55:08 +01:00
|
|
|
*/
|
2014-05-09 17:30:43 +02:00
|
|
|
public function __construct(ManiaControl $maniaControl, $connected) {
|
|
|
|
$this->maniaControl = $maniaControl;
|
2015-07-25 12:18:39 +02:00
|
|
|
$this->isConnected = (bool) $connected;
|
2014-05-03 19:53:34 +02:00
|
|
|
if ($connected) {
|
|
|
|
$this->joinTime = time();
|
2013-11-10 02:55:08 +01:00
|
|
|
}
|
2014-05-03 19:53:34 +02:00
|
|
|
}
|
2014-01-03 16:24:35 +01:00
|
|
|
|
2014-05-13 16:40:05 +02:00
|
|
|
/**
|
|
|
|
* Get the Login of the Player
|
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-13 16:40:05 +02:00
|
|
|
* @param mixed $player
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function parseLogin($player) {
|
|
|
|
if (is_object($player) && property_exists($player, 'login')) {
|
2015-07-25 12:18:39 +02:00
|
|
|
return (string) $player->login;
|
2014-05-13 16:40:05 +02:00
|
|
|
}
|
2015-07-25 12:18:39 +02:00
|
|
|
return (string) $player;
|
2014-05-13 16:40:05 +02:00
|
|
|
}
|
|
|
|
|
2014-05-09 18:42:17 +02:00
|
|
|
/**
|
|
|
|
* Get the Escaped Nickname
|
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-09 18:42:17 +02:00
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getEscapedNickname() {
|
|
|
|
$nickname = $this->nickname;
|
|
|
|
if (!$nickname) {
|
|
|
|
$nickname = $this->login;
|
|
|
|
}
|
|
|
|
return Formatter::escapeText($nickname);
|
|
|
|
}
|
|
|
|
|
2014-05-03 19:53:34 +02:00
|
|
|
/**
|
|
|
|
* Update from ManiaPlanet PlayerInfo structure
|
2014-05-09 17:30:43 +02:00
|
|
|
*
|
2014-05-03 19:53:34 +02:00
|
|
|
* @param \Maniaplanet\DedicatedServer\Structures\PlayerInfo $mpPlayer
|
|
|
|
*/
|
2014-05-09 17:30:43 +02:00
|
|
|
public function setInfo($mpPlayer) {
|
|
|
|
$this->pid = $mpPlayer->playerId;
|
|
|
|
$this->login = $mpPlayer->login;
|
|
|
|
$this->nickname = Formatter::stripDirtyCodes($mpPlayer->nickName);
|
|
|
|
$this->rawNickname = $mpPlayer->nickName;
|
|
|
|
$this->teamId = $mpPlayer->teamId;
|
|
|
|
$this->isOfficial = $mpPlayer->isInOfficialMode;
|
2014-01-23 16:15:41 +01:00
|
|
|
|
|
|
|
//Flag Details
|
|
|
|
$this->forcedSpectatorState = $mpPlayer->forceSpectator;
|
|
|
|
$this->isReferee = $mpPlayer->isReferee;
|
|
|
|
$this->isPodiumReady = $mpPlayer->isPodiumReady;
|
|
|
|
$this->isUsingStereoscopy = $mpPlayer->isUsingStereoscopy;
|
|
|
|
$this->isServer = $mpPlayer->isServer;
|
|
|
|
$this->isManagedByAnOtherServer = $mpPlayer->isManagedByAnOtherServer;
|
|
|
|
$this->hasPlayerSlot = $mpPlayer->hasPlayerSlot;
|
|
|
|
$this->hasJoinedGame = $mpPlayer->hasJoinedGame;
|
|
|
|
$this->isBroadcasting = $mpPlayer->isBroadcasting;
|
|
|
|
|
|
|
|
//Spectator Status
|
|
|
|
$this->isSpectator = $mpPlayer->spectator;
|
|
|
|
$this->isTemporarySpectator = $mpPlayer->temporarySpectator;
|
|
|
|
$this->isPureSpectator = $mpPlayer->pureSpectator;
|
|
|
|
$this->autoTarget = $mpPlayer->autoTarget;
|
|
|
|
$this->currentTargetId = $mpPlayer->currentTargetId;
|
|
|
|
|
2014-05-03 19:53:34 +02:00
|
|
|
if (!$this->nickname) {
|
|
|
|
$this->nickname = $this->login;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update from ManiaPlanet PlayerDetailedInfo structure
|
2014-05-09 17:30:43 +02:00
|
|
|
*
|
2014-05-03 19:53:34 +02:00
|
|
|
* @param \Maniaplanet\DedicatedServer\Structures\PlayerDetailedInfo $mpPlayer
|
|
|
|
*/
|
2014-05-09 17:30:43 +02:00
|
|
|
public function setDetailedInfo($mpPlayer) {
|
2014-05-03 19:53:34 +02:00
|
|
|
$this->pid = $mpPlayer->playerId;
|
|
|
|
$this->login = $mpPlayer->login;
|
|
|
|
$this->nickname = Formatter::stripDirtyCodes($mpPlayer->nickName);
|
|
|
|
$this->rawNickname = $mpPlayer->nickName;
|
|
|
|
$this->path = $mpPlayer->path;
|
|
|
|
$this->language = $mpPlayer->language;
|
|
|
|
$this->avatar = $mpPlayer->avatar->fileName;
|
|
|
|
$this->allies = $mpPlayer->allies;
|
|
|
|
$this->clubLink = $mpPlayer->clubLink;
|
|
|
|
$this->teamId = $mpPlayer->teamId;
|
|
|
|
$this->isOfficial = $mpPlayer->isInOfficialMode;
|
|
|
|
$this->ladderScore = $mpPlayer->ladderStats->playerRankings[0]->score;
|
|
|
|
$this->ladderRank = $mpPlayer->ladderStats->playerRankings[0]->ranking;
|
|
|
|
$this->ladderStats = $mpPlayer->ladderStats;
|
|
|
|
$this->daysSinceZoneInscription = $mpPlayer->hoursSinceZoneInscription / 24;
|
|
|
|
$this->ipAddress = $mpPlayer->iPAddress;
|
|
|
|
$this->clientVersion = $mpPlayer->clientVersion;
|
|
|
|
$this->downloadRate = $mpPlayer->downloadRate;
|
|
|
|
$this->uploadRate = $mpPlayer->uploadRate;
|
|
|
|
$this->skins = $mpPlayer->skins;
|
2014-02-02 13:31:35 +01:00
|
|
|
|
2014-03-31 21:54:51 +02:00
|
|
|
if (!$this->nickname) {
|
2014-01-02 14:35:00 +01:00
|
|
|
$this->nickname = $this->login;
|
2014-01-02 16:37:52 +01:00
|
|
|
}
|
2013-12-29 12:13:45 +01:00
|
|
|
}
|
2013-12-19 21:59:10 +01:00
|
|
|
|
2013-11-10 17:23:00 +01:00
|
|
|
/**
|
|
|
|
* Check if player is not a real player
|
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2013-11-10 17:23:00 +01:00
|
|
|
* @return bool
|
|
|
|
*/
|
2013-12-29 12:13:45 +01:00
|
|
|
public function isFakePlayer() {
|
2014-07-20 00:00:31 +02:00
|
|
|
return ($this->pid <= 0 || substr($this->login, 0, 1) === '*');
|
2013-11-10 17:23:00 +01:00
|
|
|
}
|
|
|
|
|
2023-12-23 12:15:00 +01:00
|
|
|
/**
|
|
|
|
* Get AccountId from Login
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getAccountId() {
|
|
|
|
if (strlen($this->login) !== 22) return $this->login;
|
|
|
|
|
|
|
|
$login = str_pad($this->login, 24, "=", STR_PAD_RIGHT);
|
|
|
|
|
|
|
|
$login = str_replace("_","/", str_replace("-","+", $login));
|
|
|
|
$login = base64_decode($login);
|
|
|
|
|
|
|
|
return vsprintf("%s%s-%s-%s-%s-%s%s%s", str_split(bin2hex($login), 4));
|
|
|
|
}
|
|
|
|
|
2013-12-18 15:48:33 +01:00
|
|
|
/**
|
|
|
|
* Get province
|
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2013-12-18 15:48:33 +01:00
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getProvince() {
|
2014-05-09 13:00:13 +02:00
|
|
|
return $this->getPathPart(3);
|
2013-12-18 15:48:33 +01:00
|
|
|
}
|
|
|
|
|
2013-11-10 17:23:00 +01:00
|
|
|
/**
|
2014-05-09 17:30:43 +02:00
|
|
|
* Get the specified Part of the Path
|
2013-11-10 17:23:00 +01:00
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-09 17:30:43 +02:00
|
|
|
* @param int $partNumber
|
2013-11-10 17:23:00 +01:00
|
|
|
* @return string
|
|
|
|
*/
|
2014-05-09 17:30:43 +02:00
|
|
|
public function getPathPart($partNumber) {
|
|
|
|
$pathParts = explode('|', $this->path);
|
|
|
|
for ($partIndex = $partNumber; $partIndex >= 0; $partIndex--) {
|
|
|
|
if (isset($pathParts[$partIndex])) {
|
|
|
|
return $pathParts[$partIndex];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->path;
|
2013-11-10 17:23:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-05-09 17:30:43 +02:00
|
|
|
* Get Country
|
2013-11-10 17:23:00 +01:00
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2013-11-10 17:23:00 +01:00
|
|
|
* @return string
|
|
|
|
*/
|
2014-05-09 17:30:43 +02:00
|
|
|
public function getCountry() {
|
|
|
|
return $this->getPathPart(2);
|
2014-05-09 13:00:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-05-09 17:30:43 +02:00
|
|
|
* Get Continent
|
2014-05-09 13:00:13 +02:00
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-09 13:00:13 +02:00
|
|
|
* @return string
|
|
|
|
*/
|
2014-05-09 17:30:43 +02:00
|
|
|
public function getContinent() {
|
|
|
|
return $this->getPathPart(1);
|
2013-11-10 02:55:08 +01:00
|
|
|
}
|
2014-01-23 16:15:41 +01:00
|
|
|
|
|
|
|
/**
|
2014-05-09 13:00:13 +02:00
|
|
|
* Update the Flags of the Player
|
2014-01-23 16:15:41 +01:00
|
|
|
*
|
|
|
|
* @param $flags
|
|
|
|
*/
|
|
|
|
public function updatePlayerFlags($flags) {
|
|
|
|
//Detail flags
|
|
|
|
$this->forcedSpectatorState = $flags % 10; // 0, 1 or 2
|
2015-07-25 12:18:39 +02:00
|
|
|
$this->isReferee = (bool) (intval($flags / 10) % 10);
|
|
|
|
$this->isPodiumReady = (bool) (intval($flags / 100) % 10);
|
|
|
|
$this->isUsingStereoscopy = (bool) (intval($flags / 1000) % 10);
|
|
|
|
$this->isManagedByAnOtherServer = (bool) (intval($flags / 10000) % 10);
|
|
|
|
$this->isServer = (bool) (intval($flags / 100000) % 10);
|
|
|
|
$this->hasPlayerSlot = (bool) (intval($flags / 1000000) % 10);
|
|
|
|
$this->isBroadcasting = (bool) (intval($flags / 10000000) % 10);
|
|
|
|
$this->hasJoinedGame = (bool) (intval($flags / 100000000) % 10);
|
2014-01-23 16:15:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-05-09 13:00:13 +02:00
|
|
|
* Update the Spectator Status of the player
|
2014-01-23 16:15:41 +01:00
|
|
|
*
|
|
|
|
* @param $spectatorStatus
|
|
|
|
*/
|
|
|
|
public function updateSpectatorStatus($spectatorStatus) {
|
|
|
|
//Details spectatorStatus
|
2015-07-25 12:18:39 +02:00
|
|
|
$this->isSpectator = (bool) ($spectatorStatus % 10);
|
|
|
|
$this->isTemporarySpectator = (bool) (intval($spectatorStatus / 10) % 10);
|
|
|
|
$this->isPureSpectator = (bool) (intval($spectatorStatus / 100) % 10);
|
|
|
|
$this->autoTarget = (bool) (intval($spectatorStatus / 1000) % 10);
|
2014-01-23 16:15:41 +01:00
|
|
|
$this->currentTargetId = intval($spectatorStatus / 10000);
|
|
|
|
}
|
2014-05-09 19:47:20 +02:00
|
|
|
|
2014-05-09 20:11:48 +02:00
|
|
|
/**
|
|
|
|
* Get the Cache with the given Name
|
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-09 23:33:24 +02:00
|
|
|
* @param $object
|
2014-05-09 20:11:48 +02:00
|
|
|
* @param string $cacheName
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-05-09 23:33:24 +02:00
|
|
|
public function getCache($object, $cacheName) {
|
2014-05-13 16:15:46 +02:00
|
|
|
$className = ClassUtil::getClass($object);
|
2014-05-09 23:33:24 +02:00
|
|
|
if (isset($this->cache[$className . $cacheName])) {
|
|
|
|
return $this->cache[$className . $cacheName];
|
2014-05-09 20:11:48 +02:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the Cache Data for the given Name
|
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-13 16:40:05 +02:00
|
|
|
* @param mixed $object
|
2014-05-09 20:11:48 +02:00
|
|
|
* @param string $cacheName
|
|
|
|
* @param mixed $data
|
|
|
|
*/
|
2014-05-09 23:33:24 +02:00
|
|
|
public function setCache($object, $cacheName, $data) {
|
2014-05-13 16:15:46 +02:00
|
|
|
$className = ClassUtil::getClass($object);
|
2014-05-09 23:33:24 +02:00
|
|
|
$this->cache[$className . $cacheName] = $data;
|
2014-05-09 20:11:48 +02:00
|
|
|
}
|
|
|
|
|
2014-05-10 10:12:48 +02:00
|
|
|
/**
|
2014-05-13 16:40:05 +02:00
|
|
|
* Destroy a Cache
|
2014-05-10 10:12:48 +02:00
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-13 16:40:05 +02:00
|
|
|
* @param mixed $object
|
|
|
|
* @param string $cacheName
|
2014-05-10 10:12:48 +02:00
|
|
|
*/
|
|
|
|
public function destroyCache($object, $cacheName) {
|
2014-05-13 16:15:46 +02:00
|
|
|
$className = ClassUtil::getClass($object);
|
2014-05-10 10:12:48 +02:00
|
|
|
unset($this->cache[$className . $cacheName]);
|
|
|
|
}
|
|
|
|
|
2014-05-09 19:47:20 +02:00
|
|
|
/**
|
|
|
|
* Clear the Player's Temporary Data
|
|
|
|
*/
|
|
|
|
public function clearCache() {
|
|
|
|
$this->cache = array();
|
|
|
|
}
|
2014-05-09 20:11:48 +02:00
|
|
|
|
2014-05-09 23:04:11 +02:00
|
|
|
/**
|
|
|
|
* Gets the Player Data
|
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-13 16:40:05 +02:00
|
|
|
* @param mixed $object
|
|
|
|
* @param string $dataName
|
|
|
|
* @param int $serverIndex
|
|
|
|
* @return mixed
|
2014-05-09 23:04:11 +02:00
|
|
|
*/
|
|
|
|
public function getPlayerData($object, $dataName, $serverIndex = -1) {
|
2014-08-13 11:05:52 +02:00
|
|
|
return $this->maniaControl->getPlayerManager()->getPlayerDataManager()->getPlayerData($object, $dataName, $this, $serverIndex);
|
2014-05-09 23:04:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-08-24 12:28:16 +02:00
|
|
|
* Sets the Player Data and stores it in the Database
|
2014-05-09 23:04:11 +02:00
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-13 16:40:05 +02:00
|
|
|
* @param mixed $object
|
|
|
|
* @param string $dataName
|
|
|
|
* @param mixed $value
|
|
|
|
* @param int $serverIndex
|
2014-05-09 23:04:11 +02:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function setPlayerData($object, $dataName, $value, $serverIndex = -1) {
|
2014-08-13 11:05:52 +02:00
|
|
|
return $this->maniaControl->getPlayerManager()->getPlayerDataManager()->setPlayerData($object, $dataName, $this, $value, $serverIndex);
|
2014-05-09 23:04:11 +02:00
|
|
|
}
|
|
|
|
|
2014-08-24 12:28:16 +02:00
|
|
|
/*
|
|
|
|
* Check if a Player is muted
|
|
|
|
*
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-08-24 12:28:16 +02:00
|
|
|
* @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;
|
|
|
|
}
|
2017-03-26 19:44:55 +02:00
|
|
|
|
2017-05-15 21:08:52 +02:00
|
|
|
/**
|
|
|
|
* Gets the Auth Level Name of a Player
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getAuthLevelName(){
|
2020-05-26 18:14:50 +02:00
|
|
|
return AuthenticationManager::getAuthLevelName(intval($this->authLevel));
|
2017-05-15 21:08:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Auth Level Abbreviation of a Player
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getAuthLevelAbbreviation(){
|
2020-05-26 18:14:50 +02:00
|
|
|
return AuthenticationManager::getAuthLevelAbbreviation(intval($this->authLevel));
|
2017-05-15 21:08:52 +02:00
|
|
|
}
|
|
|
|
|
2014-05-10 13:35:23 +02:00
|
|
|
/**
|
2014-05-13 16:40:05 +02:00
|
|
|
* Var_Dump the Players Cache
|
2017-05-15 21:08:52 +02:00
|
|
|
* @api
|
2014-05-10 13:35:23 +02:00
|
|
|
*/
|
|
|
|
public function dumpCache() {
|
2014-05-10 13:35:49 +02:00
|
|
|
var_dump($this->cache);
|
2014-05-10 13:35:23 +02:00
|
|
|
}
|
2013-11-09 20:18:49 +01:00
|
|
|
}
|