Protocol updates for 1.1.0.9

This commit is contained in:
Dylan K. Taylor 2017-04-27 11:24:16 +01:00
parent bf9b8722c9
commit dc71eb5246
2 changed files with 15 additions and 4 deletions

View File

@ -31,7 +31,8 @@ class MovePlayerPacket extends DataPacket{
const MODE_NORMAL = 0;
const MODE_RESET = 1;
const MODE_ROTATION = 2;
const MODE_TELEPORT = 2;
const MODE_PITCH = 3; //facepalm Mojang
public $eid;
public $x;
@ -43,6 +44,8 @@ class MovePlayerPacket extends DataPacket{
public $mode = self::MODE_NORMAL;
public $onGround;
public $ridingEid;
public $int1 = 0;
public $int2 = 0;
public function decode(){
$this->eid = $this->getEntityRuntimeId();
@ -53,6 +56,10 @@ class MovePlayerPacket extends DataPacket{
$this->mode = $this->getByte();
$this->onGround = $this->getBool();
$this->ridingEid = $this->getEntityRuntimeId();
if($this->mode === MovePlayerPacket::MODE_TELEPORT){
$this->int1 = $this->getLInt();
$this->int2 = $this->getLInt();
}
}
public function encode(){
@ -65,6 +72,10 @@ class MovePlayerPacket extends DataPacket{
$this->putByte($this->mode);
$this->putBool($this->onGround);
$this->putEntityRuntimeId($this->ridingEid);
if($this->mode === MovePlayerPacket::MODE_TELEPORT){
$this->putLInt($this->int1);
$this->putLInt($this->int2);
}
}
public function handle(NetworkSession $session) : bool{

View File

@ -31,9 +31,9 @@ interface ProtocolInfo{
/**
* Actual Minecraft: PE protocol version
*/
const CURRENT_PROTOCOL = 111;
const MINECRAFT_VERSION = 'v1.1.0.8 beta';
const MINECRAFT_VERSION_NETWORK = '1.1.0.8';
const CURRENT_PROTOCOL = 112;
const MINECRAFT_VERSION = 'v1.1.0.9 beta';
const MINECRAFT_VERSION_NETWORK = '1.1.0.9';
const LOGIN_PACKET = 0x01;
const PLAY_STATUS_PACKET = 0x02;