Updated for 1.2.0.18

This commit is contained in:
Dylan K. Taylor 2017-08-18 12:36:04 +01:00
parent 09c53552c1
commit 8853452feb
6 changed files with 24 additions and 7 deletions

View File

@ -101,6 +101,7 @@ use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket;
use pocketmine\network\mcpe\protocol\ServerSettingsResponsePacket; use pocketmine\network\mcpe\protocol\ServerSettingsResponsePacket;
use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket; use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket;
use pocketmine\network\mcpe\protocol\SetCommandsEnabledPacket; use pocketmine\network\mcpe\protocol\SetCommandsEnabledPacket;
use pocketmine\network\mcpe\protocol\SetDefaultGameTypePacket;
use pocketmine\network\mcpe\protocol\SetDifficultyPacket; use pocketmine\network\mcpe\protocol\SetDifficultyPacket;
use pocketmine\network\mcpe\protocol\SetEntityDataPacket; use pocketmine\network\mcpe\protocol\SetEntityDataPacket;
use pocketmine\network\mcpe\protocol\SetEntityLinkPacket; use pocketmine\network\mcpe\protocol\SetEntityLinkPacket;
@ -549,4 +550,8 @@ abstract class NetworkSession{
return false; return false;
} }
public function handleSetDefaultGameType(SetDefaultGameTypePacket $packet) : bool{
return false;
}
} }

View File

@ -61,6 +61,7 @@ class AddPlayerPacket extends DataPacket{
public $uvarint2 = 0; public $uvarint2 = 0;
public $uvarint3 = 0; public $uvarint3 = 0;
public $uvarint4 = 0; public $uvarint4 = 0;
public $uvarint5 = 0;
public $long1 = 0; public $long1 = 0;
@ -83,6 +84,7 @@ class AddPlayerPacket extends DataPacket{
$this->uvarint2 = $this->getUnsignedVarInt(); $this->uvarint2 = $this->getUnsignedVarInt();
$this->uvarint3 = $this->getUnsignedVarInt(); $this->uvarint3 = $this->getUnsignedVarInt();
$this->uvarint4 = $this->getUnsignedVarInt(); $this->uvarint4 = $this->getUnsignedVarInt();
$this->uvarint5 = $this->getUnsignedVarInt();
$this->long1 = $this->getLLong(); $this->long1 = $this->getLLong();
@ -109,6 +111,7 @@ class AddPlayerPacket extends DataPacket{
$this->putUnsignedVarInt($this->uvarint2); $this->putUnsignedVarInt($this->uvarint2);
$this->putUnsignedVarInt($this->uvarint3); $this->putUnsignedVarInt($this->uvarint3);
$this->putUnsignedVarInt($this->uvarint4); $this->putUnsignedVarInt($this->uvarint4);
$this->putUnsignedVarInt($this->uvarint5);
$this->putLLong($this->long1); $this->putLLong($this->long1);

View File

@ -74,6 +74,8 @@ class AdventureSettingsPacket extends DataPacket{
/** @var int */ /** @var int */
public $playerPermission = PlayerPermissions::MEMBER; public $playerPermission = PlayerPermissions::MEMBER;
/** @var int */ /** @var int */
public $customFlags = 0; //...
/** @var int */
public $entityUniqueId; //This is a little-endian long, NOT a var-long. (WTF Mojang) public $entityUniqueId; //This is a little-endian long, NOT a var-long. (WTF Mojang)
protected function decodePayload(){ protected function decodePayload(){
@ -81,6 +83,7 @@ class AdventureSettingsPacket extends DataPacket{
$this->commandPermission = $this->getUnsignedVarInt(); $this->commandPermission = $this->getUnsignedVarInt();
$this->flags2 = $this->getUnsignedVarInt(); $this->flags2 = $this->getUnsignedVarInt();
$this->playerPermission = $this->getUnsignedVarInt(); $this->playerPermission = $this->getUnsignedVarInt();
$this->customFlags = $this->getUnsignedVarInt();
$this->entityUniqueId = $this->getLLong(); $this->entityUniqueId = $this->getLLong();
} }
@ -89,6 +92,7 @@ class AdventureSettingsPacket extends DataPacket{
$this->putUnsignedVarInt($this->commandPermission); $this->putUnsignedVarInt($this->commandPermission);
$this->putUnsignedVarInt($this->flags2); $this->putUnsignedVarInt($this->flags2);
$this->putUnsignedVarInt($this->playerPermission); $this->putUnsignedVarInt($this->playerPermission);
$this->putUnsignedVarInt($this->customFlags);
$this->putLLong($this->entityUniqueId); $this->putLLong($this->entityUniqueId);
} }

View File

@ -135,6 +135,7 @@ class PacketPool{
static::registerPacket(new ServerSettingsRequestPacket()); static::registerPacket(new ServerSettingsRequestPacket());
static::registerPacket(new ServerSettingsResponsePacket()); static::registerPacket(new ServerSettingsResponsePacket());
static::registerPacket(new ShowProfilePacket()); static::registerPacket(new ShowProfilePacket());
static::registerPacket(new SetDefaultGameTypePacket());
static::registerPacket(new BatchPacket()); static::registerPacket(new BatchPacket());
} }

View File

@ -39,15 +39,15 @@ interface ProtocolInfo{
/** /**
* Actual Minecraft: PE protocol version * 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. * 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. * 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 LOGIN_PACKET = 0x01;
const PLAY_STATUS_PACKET = 0x02; const PLAY_STATUS_PACKET = 0x02;
@ -153,5 +153,6 @@ interface ProtocolInfo{
const SERVER_SETTINGS_REQUEST_PACKET = 0x66; const SERVER_SETTINGS_REQUEST_PACKET = 0x66;
const SERVER_SETTINGS_RESPONSE_PACKET = 0x67; const SERVER_SETTINGS_RESPONSE_PACKET = 0x67;
const SHOW_PROFILE_PACKET = 0x68; const SHOW_PROFILE_PACKET = 0x68;
const SET_DEFAULT_GAME_TYPE_PACKET = 0x69;
} }

View File

@ -35,10 +35,11 @@ class TextPacket extends DataPacket{
const TYPE_CHAT = 1; const TYPE_CHAT = 1;
const TYPE_TRANSLATION = 2; const TYPE_TRANSLATION = 2;
const TYPE_POPUP = 3; const TYPE_POPUP = 3;
const TYPE_TIP = 4; const TYPE_JUKEBOX_POPUP = 4;
const TYPE_SYSTEM = 5; const TYPE_TIP = 5;
const TYPE_WHISPER = 6; const TYPE_SYSTEM = 6;
const TYPE_ANNOUNCEMENT = 7; const TYPE_WHISPER = 7;
const TYPE_ANNOUNCEMENT = 8;
/** @var int */ /** @var int */
public $type; public $type;
@ -67,6 +68,7 @@ class TextPacket extends DataPacket{
$this->message = $this->getString(); $this->message = $this->getString();
break; break;
case self::TYPE_JUKEBOX_POPUP:
case self::TYPE_TRANSLATION: case self::TYPE_TRANSLATION:
$this->message = $this->getString(); $this->message = $this->getString();
$count = $this->getUnsignedVarInt(); $count = $this->getUnsignedVarInt();
@ -92,6 +94,7 @@ class TextPacket extends DataPacket{
$this->putString($this->message); $this->putString($this->message);
break; break;
case self::TYPE_JUKEBOX_POPUP:
case self::TYPE_TRANSLATION: case self::TYPE_TRANSLATION:
$this->putString($this->message); $this->putString($this->message);
$this->putUnsignedVarInt(count($this->parameters)); $this->putUnsignedVarInt(count($this->parameters));