mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Player: get rid of CID requirement from player info, CID is still available via extradata if supported by client impl
this is useless for PM and it doesn't have any fit purpose for plugin use either, so it doesn't make sense to expose it to the API.
This commit is contained in:
parent
018a4467bf
commit
dbdcabcc56
@ -92,7 +92,6 @@ class LoginPacketHandler extends PacketHandler{
|
||||
$skin,
|
||||
$packet->clientData[LoginPacket::I_LANGUAGE_CODE],
|
||||
$packet->extraData[LoginPacket::I_XUID],
|
||||
$packet->clientData[LoginPacket::I_CLIENT_RANDOM_ID],
|
||||
$packet->clientData
|
||||
));
|
||||
|
||||
|
@ -162,8 +162,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
protected $username;
|
||||
/** @var string */
|
||||
protected $displayName;
|
||||
/** @var int */
|
||||
protected $randomClientId;
|
||||
/** @var string */
|
||||
protected $xuid = "";
|
||||
/** @var bool */
|
||||
@ -270,7 +268,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
$this->username = $username;
|
||||
$this->displayName = $this->username;
|
||||
$this->locale = $this->playerInfo->getLocale();
|
||||
$this->randomClientId = $this->playerInfo->getClientId();
|
||||
|
||||
$this->uuid = $this->playerInfo->getUuid();
|
||||
$this->xuid = $this->playerInfo->getXuid();
|
||||
@ -384,16 +381,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* This might disappear in the future. Please use getUniqueId() instead.
|
||||
* @deprecated
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getClientId(){
|
||||
return $this->randomClientId;
|
||||
}
|
||||
|
||||
public function isBanned() : bool{
|
||||
return $this->server->getNameBans()->isBanned($this->username);
|
||||
}
|
||||
|
@ -42,8 +42,6 @@ class PlayerInfo{
|
||||
private $locale;
|
||||
/** @var string */
|
||||
private $xuid;
|
||||
/** @var int */
|
||||
private $clientId;
|
||||
/** @var array */
|
||||
private $extraData;
|
||||
|
||||
@ -53,16 +51,14 @@ class PlayerInfo{
|
||||
* @param Skin $skin
|
||||
* @param string $locale
|
||||
* @param string $xuid
|
||||
* @param int $clientId
|
||||
* @param array $extraData
|
||||
*/
|
||||
public function __construct(string $username, UUID $uuid, Skin $skin, string $locale, string $xuid, int $clientId, array $extraData = []){
|
||||
public function __construct(string $username, UUID $uuid, Skin $skin, string $locale, string $xuid, array $extraData = []){
|
||||
$this->username = TextFormat::clean($username);
|
||||
$this->uuid = $uuid;
|
||||
$this->skin = $skin;
|
||||
$this->locale = $locale;
|
||||
$this->xuid = $xuid;
|
||||
$this->clientId = $clientId;
|
||||
$this->extraData = $extraData;
|
||||
}
|
||||
|
||||
@ -101,13 +97,6 @@ class PlayerInfo{
|
||||
return $this->xuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getClientId() : int{
|
||||
return $this->clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user