diff --git a/src/pocketmine/network/mcpe/NetworkSession.php b/src/pocketmine/network/mcpe/NetworkSession.php index 2decdaf9cc..85ac0e1f65 100644 --- a/src/pocketmine/network/mcpe/NetworkSession.php +++ b/src/pocketmine/network/mcpe/NetworkSession.php @@ -101,6 +101,7 @@ use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket; use pocketmine\network\mcpe\protocol\ServerSettingsResponsePacket; use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket; use pocketmine\network\mcpe\protocol\SetCommandsEnabledPacket; +use pocketmine\network\mcpe\protocol\SetDefaultGameTypePacket; use pocketmine\network\mcpe\protocol\SetDifficultyPacket; use pocketmine\network\mcpe\protocol\SetEntityDataPacket; use pocketmine\network\mcpe\protocol\SetEntityLinkPacket; @@ -549,4 +550,8 @@ abstract class NetworkSession{ return false; } + public function handleSetDefaultGameType(SetDefaultGameTypePacket $packet) : bool{ + return false; + } + } \ No newline at end of file diff --git a/src/pocketmine/network/mcpe/protocol/AddPlayerPacket.php b/src/pocketmine/network/mcpe/protocol/AddPlayerPacket.php index 68adb04641..c9e3e40958 100644 --- a/src/pocketmine/network/mcpe/protocol/AddPlayerPacket.php +++ b/src/pocketmine/network/mcpe/protocol/AddPlayerPacket.php @@ -61,6 +61,7 @@ class AddPlayerPacket extends DataPacket{ public $uvarint2 = 0; public $uvarint3 = 0; public $uvarint4 = 0; + public $uvarint5 = 0; public $long1 = 0; @@ -83,6 +84,7 @@ class AddPlayerPacket extends DataPacket{ $this->uvarint2 = $this->getUnsignedVarInt(); $this->uvarint3 = $this->getUnsignedVarInt(); $this->uvarint4 = $this->getUnsignedVarInt(); + $this->uvarint5 = $this->getUnsignedVarInt(); $this->long1 = $this->getLLong(); @@ -109,6 +111,7 @@ class AddPlayerPacket extends DataPacket{ $this->putUnsignedVarInt($this->uvarint2); $this->putUnsignedVarInt($this->uvarint3); $this->putUnsignedVarInt($this->uvarint4); + $this->putUnsignedVarInt($this->uvarint5); $this->putLLong($this->long1); diff --git a/src/pocketmine/network/mcpe/protocol/AdventureSettingsPacket.php b/src/pocketmine/network/mcpe/protocol/AdventureSettingsPacket.php index 9252d24a88..078f8d228e 100644 --- a/src/pocketmine/network/mcpe/protocol/AdventureSettingsPacket.php +++ b/src/pocketmine/network/mcpe/protocol/AdventureSettingsPacket.php @@ -74,6 +74,8 @@ class AdventureSettingsPacket extends DataPacket{ /** @var int */ public $playerPermission = PlayerPermissions::MEMBER; /** @var int */ + public $customFlags = 0; //... + /** @var int */ public $entityUniqueId; //This is a little-endian long, NOT a var-long. (WTF Mojang) protected function decodePayload(){ @@ -81,6 +83,7 @@ class AdventureSettingsPacket extends DataPacket{ $this->commandPermission = $this->getUnsignedVarInt(); $this->flags2 = $this->getUnsignedVarInt(); $this->playerPermission = $this->getUnsignedVarInt(); + $this->customFlags = $this->getUnsignedVarInt(); $this->entityUniqueId = $this->getLLong(); } @@ -89,6 +92,7 @@ class AdventureSettingsPacket extends DataPacket{ $this->putUnsignedVarInt($this->commandPermission); $this->putUnsignedVarInt($this->flags2); $this->putUnsignedVarInt($this->playerPermission); + $this->putUnsignedVarInt($this->customFlags); $this->putLLong($this->entityUniqueId); } diff --git a/src/pocketmine/network/mcpe/protocol/PacketPool.php b/src/pocketmine/network/mcpe/protocol/PacketPool.php index 42bfb4e578..8c0a84f7c6 100644 --- a/src/pocketmine/network/mcpe/protocol/PacketPool.php +++ b/src/pocketmine/network/mcpe/protocol/PacketPool.php @@ -135,6 +135,7 @@ class PacketPool{ static::registerPacket(new ServerSettingsRequestPacket()); static::registerPacket(new ServerSettingsResponsePacket()); static::registerPacket(new ShowProfilePacket()); + static::registerPacket(new SetDefaultGameTypePacket()); static::registerPacket(new BatchPacket()); } diff --git a/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php b/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php index 20dc3dab69..41cf2672dc 100644 --- a/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php +++ b/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php @@ -39,15 +39,15 @@ interface ProtocolInfo{ /** * Actual Minecraft: PE protocol version */ - const CURRENT_PROTOCOL = 132; + const CURRENT_PROTOCOL = 133; /** * Current Minecraft PE version reported by the server. This is usually the earliest currently supported version. */ - const MINECRAFT_VERSION = 'v1.2.0.11 beta'; + const MINECRAFT_VERSION = 'v1.2.0.18 beta'; /** * Version number sent to clients in ping responses. */ - const MINECRAFT_VERSION_NETWORK = '1.2.0.11'; + const MINECRAFT_VERSION_NETWORK = '1.2.0.18'; const LOGIN_PACKET = 0x01; const PLAY_STATUS_PACKET = 0x02; @@ -153,5 +153,6 @@ interface ProtocolInfo{ const SERVER_SETTINGS_REQUEST_PACKET = 0x66; const SERVER_SETTINGS_RESPONSE_PACKET = 0x67; const SHOW_PROFILE_PACKET = 0x68; + const SET_DEFAULT_GAME_TYPE_PACKET = 0x69; } diff --git a/src/pocketmine/network/mcpe/protocol/TextPacket.php b/src/pocketmine/network/mcpe/protocol/TextPacket.php index b5350fa37f..2f5923129c 100644 --- a/src/pocketmine/network/mcpe/protocol/TextPacket.php +++ b/src/pocketmine/network/mcpe/protocol/TextPacket.php @@ -35,10 +35,11 @@ class TextPacket extends DataPacket{ const TYPE_CHAT = 1; const TYPE_TRANSLATION = 2; const TYPE_POPUP = 3; - const TYPE_TIP = 4; - const TYPE_SYSTEM = 5; - const TYPE_WHISPER = 6; - const TYPE_ANNOUNCEMENT = 7; + const TYPE_JUKEBOX_POPUP = 4; + const TYPE_TIP = 5; + const TYPE_SYSTEM = 6; + const TYPE_WHISPER = 7; + const TYPE_ANNOUNCEMENT = 8; /** @var int */ public $type; @@ -67,6 +68,7 @@ class TextPacket extends DataPacket{ $this->message = $this->getString(); break; + case self::TYPE_JUKEBOX_POPUP: case self::TYPE_TRANSLATION: $this->message = $this->getString(); $count = $this->getUnsignedVarInt(); @@ -92,6 +94,7 @@ class TextPacket extends DataPacket{ $this->putString($this->message); break; + case self::TYPE_JUKEBOX_POPUP: case self::TYPE_TRANSLATION: $this->putString($this->message); $this->putUnsignedVarInt(count($this->parameters));