mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Bump version to 0.15.0.0 and protocol changes
This commit is contained in:
@ -101,7 +101,7 @@ use pocketmine\nbt\tag\StringTag;
|
||||
use pocketmine\network\protocol\AdventureSettingsPacket;
|
||||
use pocketmine\network\protocol\AnimatePacket;
|
||||
use pocketmine\network\protocol\BatchPacket;
|
||||
use pocketmine\network\protocol\ChunkRadiusUpdatePacket;
|
||||
use pocketmine\network\protocol\ChunkRadiusUpdatedPacket;
|
||||
use pocketmine\network\protocol\ContainerClosePacket;
|
||||
use pocketmine\network\protocol\ContainerSetContentPacket;
|
||||
use pocketmine\network\protocol\DataPacket;
|
||||
@ -133,6 +133,7 @@ use pocketmine\tile\Sign;
|
||||
use pocketmine\tile\Spawnable;
|
||||
use pocketmine\tile\Tile;
|
||||
use pocketmine\utils\TextFormat;
|
||||
use pocketmine\utils\UUID;
|
||||
use raklib\Binary;
|
||||
|
||||
|
||||
@ -1568,6 +1569,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
|
||||
public function tryAuthenticate(){
|
||||
$pk = new PlayStatusPacket();
|
||||
$pk->status = PlayStatusPacket::LOGIN_SUCCESS;
|
||||
$this->dataPacket($pk);
|
||||
//TODO: implement authentication after it is available
|
||||
$this->authenticateCallback(true);
|
||||
}
|
||||
@ -1614,7 +1618,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->setNameTag($this->username);
|
||||
|
||||
$nbt = $this->server->getOfflinePlayerData($this->username);
|
||||
$this->playedBefore = ($nbt["lastPlayed"] - $nbt["firstPlayed"]) > 1; // microtime(true) - microtime(true) may have less than one millisecond difference
|
||||
if(!isset($nbt->NameTag)){
|
||||
@ -1787,15 +1792,14 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
|
||||
$this->username = TextFormat::clean($packet->username);
|
||||
$this->displayName = $this->username;
|
||||
$this->setNameTag($this->username);
|
||||
$this->iusername = strtolower($this->username);
|
||||
|
||||
if(count($this->server->getOnlinePlayers()) >= $this->server->getMaxPlayers() and $this->kick("disconnectionScreen.serverFull", false)){
|
||||
break;
|
||||
}
|
||||
|
||||
if($packet->protocol1 !== ProtocolInfo::CURRENT_PROTOCOL){
|
||||
if($packet->protocol1 < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
if($packet->protocol !== ProtocolInfo::CURRENT_PROTOCOL){
|
||||
if($packet->protocol < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
$message = "disconnectionScreen.outdatedClient";
|
||||
|
||||
$pk = new PlayStatusPacket();
|
||||
@ -1815,9 +1819,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
|
||||
$this->randomClientId = $packet->clientId;
|
||||
|
||||
$this->uuid = $packet->clientUUID;
|
||||
$this->uuid = UUID::fromString($packet->clientUUID);
|
||||
$this->rawUUID = $this->uuid->toBinary();
|
||||
$this->clientSecret = $packet->clientSecret;
|
||||
|
||||
$valid = true;
|
||||
$len = strlen($packet->username);
|
||||
@ -1848,7 +1851,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
break;
|
||||
}
|
||||
|
||||
$this->setSkin($packet->skin, $packet->skinName);
|
||||
$this->setSkin($packet->skin, $packet->skinID);
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerPreLoginEvent($this, "Plugin reason"));
|
||||
if($ev->isCancelled()){
|
||||
@ -2848,7 +2851,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
if($this->spawned){
|
||||
$this->viewDistance = $packet->radius ** 2;
|
||||
}
|
||||
$pk = new ChunkRadiusUpdatePacket();
|
||||
$pk = new ChunkRadiusUpdatedPacket();
|
||||
$pk->radius = $packet->radius;
|
||||
$this->dataPacket($pk);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user