mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Removed RakNet client ID parameters from Player
This is not used anywhere anymore and null is always filled for this, so it's pointless. Also, this is an API break.
This commit is contained in:
parent
f27b62027c
commit
6954bfac4b
@ -243,7 +243,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
protected $startAction = -1;
|
||||
/** @var Vector3|null */
|
||||
protected $sleeping = null;
|
||||
protected $clientID = null;
|
||||
|
||||
private $loaderId = 0;
|
||||
|
||||
@ -678,18 +677,16 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
/**
|
||||
* @param SourceInterface $interface
|
||||
* @param null $clientID
|
||||
* @param string $ip
|
||||
* @param int $port
|
||||
*/
|
||||
public function __construct(SourceInterface $interface, $clientID, string $ip, int $port){
|
||||
public function __construct(SourceInterface $interface, string $ip, int $port){
|
||||
$this->interface = $interface;
|
||||
$this->perm = new PermissibleBase($this);
|
||||
$this->namedtag = new CompoundTag();
|
||||
$this->server = Server::getInstance();
|
||||
$this->ip = $ip;
|
||||
$this->port = $port;
|
||||
$this->clientID = $clientID;
|
||||
$this->loaderId = Level::generateChunkLoaderId($this);
|
||||
$this->chunksPerTick = (int) $this->server->getProperty("chunk-sending.per-tick", 4);
|
||||
$this->spawnThreshold = (int) (($this->server->getProperty("chunk-sending.spawn-radius", 4) ** 2) * M_PI);
|
||||
|
@ -35,8 +35,6 @@ class PlayerCreationEvent extends Event{
|
||||
|
||||
/** @var SourceInterface */
|
||||
private $interface;
|
||||
/** @var mixed */
|
||||
private $clientId;
|
||||
/** @var string */
|
||||
private $address;
|
||||
/** @var int */
|
||||
@ -51,13 +49,11 @@ class PlayerCreationEvent extends Event{
|
||||
* @param SourceInterface $interface
|
||||
* @param Player::class $baseClass
|
||||
* @param Player::class $playerClass
|
||||
* @param mixed $clientId
|
||||
* @param string $address
|
||||
* @param int $port
|
||||
*/
|
||||
public function __construct(SourceInterface $interface, $baseClass, $playerClass, $clientId, string $address, int $port){
|
||||
public function __construct(SourceInterface $interface, $baseClass, $playerClass, string $address, int $port){
|
||||
$this->interface = $interface;
|
||||
$this->clientId = $clientId;
|
||||
$this->address = $address;
|
||||
$this->port = $port;
|
||||
|
||||
@ -95,13 +91,6 @@ class PlayerCreationEvent extends Event{
|
||||
return $this->port;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getClientId(){
|
||||
return $this->clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player::class
|
||||
*/
|
||||
|
@ -128,11 +128,11 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
}
|
||||
|
||||
public function openSession($identifier, $address, $port, $clientID){
|
||||
$ev = new PlayerCreationEvent($this, Player::class, Player::class, null, $address, $port);
|
||||
$ev = new PlayerCreationEvent($this, Player::class, Player::class, $address, $port);
|
||||
$this->server->getPluginManager()->callEvent($ev);
|
||||
$class = $ev->getPlayerClass();
|
||||
|
||||
$player = new $class($this, $ev->getClientId(), $ev->getAddress(), $ev->getPort());
|
||||
$player = new $class($this, $ev->getAddress(), $ev->getPort());
|
||||
$this->players[$identifier] = $player;
|
||||
$this->identifiersACK[$identifier] = 0;
|
||||
$this->identifiers[spl_object_hash($player)] = $identifier;
|
||||
|
Loading…
x
Reference in New Issue
Block a user