Support for 0.14.0.1

This commit is contained in:
Intyre 2016-01-26 22:01:35 +01:00
parent d5f3c19054
commit bc3dca4736
No known key found for this signature in database
GPG Key ID: B06D41D26935005A
4 changed files with 17 additions and 13 deletions

View File

@ -75,8 +75,8 @@ namespace pocketmine {
const VERSION = "1.6dev"; const VERSION = "1.6dev";
const API_VERSION = "2.0.0"; const API_VERSION = "2.0.0";
const CODENAME = "[REDACTED]"; const CODENAME = "[REDACTED]";
const MINECRAFT_VERSION = "v0.13.1 alpha"; const MINECRAFT_VERSION = "v0.14.0.1 alpha";
const MINECRAFT_VERSION_NETWORK = "0.13.1"; const MINECRAFT_VERSION_NETWORK = "0.14.0.1";
/* /*
* Startup code. Do not look at it, it may harm you. * Startup code. Do not look at it, it may harm you.

View File

@ -218,12 +218,12 @@ class Network{
$buf = substr($str, $offset, $pkLen); $buf = substr($str, $offset, $pkLen);
$offset += $pkLen; $offset += $pkLen;
if(($pk = $this->getPacket(ord($buf{0}))) !== null){ if(($pk = $this->getPacket(ord($buf{1}))) !== null){ // #blameshoghi
if($pk::NETWORK_ID === Info::BATCH_PACKET){ if($pk::NETWORK_ID === Info::BATCH_PACKET){
throw new \InvalidStateException("Invalid BatchPacket inside BatchPacket"); throw new \InvalidStateException("Invalid BatchPacket inside BatchPacket");
} }
$pk->setBuffer($buf, 1); $pk->setBuffer($buf, 2); // #blameshoghi
$pk->decode(); $pk->decode();
$p->handleDataPacket($pk); $p->handleDataPacket($pk);

View File

@ -199,7 +199,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
if(!isset($packet->__encapsulatedPacket)){ if(!isset($packet->__encapsulatedPacket)){
$packet->__encapsulatedPacket = new CachedEncapsulatedPacket; $packet->__encapsulatedPacket = new CachedEncapsulatedPacket;
$packet->__encapsulatedPacket->identifierACK = null; $packet->__encapsulatedPacket->identifierACK = null;
$packet->__encapsulatedPacket->buffer = $packet->buffer; $packet->__encapsulatedPacket->buffer = chr(0x8e) . $packet->buffer; // #blameshoghi
$packet->__encapsulatedPacket->reliability = 3; $packet->__encapsulatedPacket->reliability = 3;
$packet->__encapsulatedPacket->orderChannel = 0; $packet->__encapsulatedPacket->orderChannel = 0;
} }
@ -215,7 +215,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
if($pk === null){ if($pk === null){
$pk = new EncapsulatedPacket(); $pk = new EncapsulatedPacket();
$pk->buffer = $packet->buffer; $pk->buffer = chr(0x8e) . $packet->buffer; // #blameshoghi
$packet->reliability = 3; $packet->reliability = 3;
$packet->orderChannel = 0; $packet->orderChannel = 0;
@ -233,12 +233,12 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
} }
private function getPacket($buffer){ private function getPacket($buffer){
$pid = ord($buffer{0}); $pid = ord($buffer{1}); // #blameshoghi
if(($data = $this->network->getPacket($pid)) === null){ if(($data = $this->network->getPacket($pid)) === null){
return null; return null;
} }
$data->setBuffer($buffer, 1); $data->setBuffer($buffer, 2); // #blameshoghi
return $data; return $data;
} }

View File

@ -30,7 +30,7 @@ interface Info{
/** /**
* Actual Minecraft: PE protocol version * Actual Minecraft: PE protocol version
*/ */
const CURRENT_PROTOCOL = 38; const CURRENT_PROTOCOL = 41;
const LOGIN_PACKET = 0x8f; const LOGIN_PACKET = 0x8f;
const PLAY_STATUS_PACKET = 0x90; const PLAY_STATUS_PACKET = 0x90;
@ -79,14 +79,18 @@ interface Info{
const CRAFTING_EVENT_PACKET = 0xbb; const CRAFTING_EVENT_PACKET = 0xbb;
const ADVENTURE_SETTINGS_PACKET = 0xbc; const ADVENTURE_SETTINGS_PACKET = 0xbc;
const BLOCK_ENTITY_DATA_PACKET = 0xbd; const BLOCK_ENTITY_DATA_PACKET = 0xbd;
//const PLAYER_INPUT_PACKET = 0xbe; // const PLAYER_INPUT_PACKET = 0xbe;
const FULL_CHUNK_DATA_PACKET = 0xbf; const FULL_CHUNK_DATA_PACKET = 0xbf;
const SET_DIFFICULTY_PACKET = 0xc0; const SET_DIFFICULTY_PACKET = 0xc0;
//const CHANGE_DIMENSION_PACKET = 0xc1; // const CHANGE_DIMENSION_PACKET = 0xc1;
const SET_PLAYER_GAMETYPE_PACKET = 0xc2; const SET_PLAYER_GAMETYPE_PACKET = 0xc2;
const PLAYER_LIST_PACKET = 0xc3; const PLAYER_LIST_PACKET = 0xc3;
//const TELEMETRY_EVENT_PACKET = 0xc4; // const TELEMETRY_EVENT_PACKET = 0xc4;
//const SPAWN_EXPERIENCE_ORB_PACKET = 0xc5 // const SPAWN_EXPERIENCE_ORB_PACKET = 0xc5
// const CLIENTBOUND_MAP_ITEM_DATA_PACKET = 0xc6;
// const MAP_INFO_REQUEST_PACKET = 0xc7;
// const REQUEST_CHUNK_RADIUS_PACKET = 0xc8;
// const CHUNK_RADIUS_UPDATE_PACKET = 0xc9;
} }