Bump protocol and fixed packets for 0.13.0

This commit is contained in:
Intyre 2015-11-23 21:01:02 +01:00
parent f9d7e204c8
commit 2ea81710ad
No known key found for this signature in database
GPG Key ID: B06D41D26935005A
9 changed files with 31 additions and 27 deletions

View File

@ -1833,7 +1833,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
} }
$this->randomClientId = $packet->clientId; $this->randomClientId = $packet->clientId;
$this->loginData = ["clientId" => $packet->clientId, "loginData" => null];
$this->uuid = $packet->clientUUID; $this->uuid = $packet->clientUUID;
$this->rawUUID = $this->uuid->toBinary(); $this->rawUUID = $this->uuid->toBinary();
@ -2863,7 +2862,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
} }
break; break;
case ProtocolInfo::TILE_ENTITY_DATA_PACKET: case ProtocolInfo::BLOCK_ENTITY_DATA_PACKET:
if($this->spawned === false or $this->blocked === true or !$this->isAlive()){ if($this->spawned === false or $this->blocked === true or !$this->isAlive()){
break; break;
} }

View File

@ -75,8 +75,8 @@ namespace pocketmine {
const VERSION = "1.6dev"; const VERSION = "1.6dev";
const API_VERSION = "1.13.0"; const API_VERSION = "1.13.0";
const CODENAME = "[REDACTED]"; const CODENAME = "[REDACTED]";
const MINECRAFT_VERSION = "v0.12.1 alpha"; const MINECRAFT_VERSION = "v0.13.0 alpha";
const MINECRAFT_VERSION_NETWORK = "0.12.1"; const MINECRAFT_VERSION_NETWORK = "0.13.0";
/* /*
* Startup code. Do not look at it, it may harm you. * Startup code. Do not look at it, it may harm you.

View File

@ -43,7 +43,7 @@ use pocketmine\network\protocol\DropItemPacket;
use pocketmine\network\protocol\FullChunkDataPacket; use pocketmine\network\protocol\FullChunkDataPacket;
use pocketmine\network\protocol\Info; use pocketmine\network\protocol\Info;
use pocketmine\network\protocol\SetEntityLinkPacket; use pocketmine\network\protocol\SetEntityLinkPacket;
use pocketmine\network\protocol\TileEntityDataPacket; use pocketmine\network\protocol\BlockEntityDataPacket;
use pocketmine\network\protocol\EntityEventPacket; use pocketmine\network\protocol\EntityEventPacket;
use pocketmine\network\protocol\ExplodePacket; use pocketmine\network\protocol\ExplodePacket;
use pocketmine\network\protocol\HurtArmorPacket; use pocketmine\network\protocol\HurtArmorPacket;
@ -71,7 +71,7 @@ use pocketmine\network\protocol\SetSpawnPositionPacket;
use pocketmine\network\protocol\SetTimePacket; use pocketmine\network\protocol\SetTimePacket;
use pocketmine\network\protocol\StartGamePacket; use pocketmine\network\protocol\StartGamePacket;
use pocketmine\network\protocol\TakeItemEntityPacket; use pocketmine\network\protocol\TakeItemEntityPacket;
use pocketmine\network\protocol\TileEventPacket; use pocketmine\network\protocol\BlockEventPacket;
use pocketmine\network\protocol\UpdateBlockPacket; use pocketmine\network\protocol\UpdateBlockPacket;
use pocketmine\network\protocol\UseItemPacket; use pocketmine\network\protocol\UseItemPacket;
use pocketmine\network\protocol\PlayerListPacket; use pocketmine\network\protocol\PlayerListPacket;
@ -325,7 +325,7 @@ class Network{
$this->registerPacket(ProtocolInfo::ADD_PAINTING_PACKET, AddPaintingPacket::class); $this->registerPacket(ProtocolInfo::ADD_PAINTING_PACKET, AddPaintingPacket::class);
$this->registerPacket(ProtocolInfo::EXPLODE_PACKET, ExplodePacket::class); $this->registerPacket(ProtocolInfo::EXPLODE_PACKET, ExplodePacket::class);
$this->registerPacket(ProtocolInfo::LEVEL_EVENT_PACKET, LevelEventPacket::class); $this->registerPacket(ProtocolInfo::LEVEL_EVENT_PACKET, LevelEventPacket::class);
$this->registerPacket(ProtocolInfo::TILE_EVENT_PACKET, TileEventPacket::class); $this->registerPacket(ProtocolInfo::BLOCK_EVENT_PACKET, BlockEventPacket::class);
$this->registerPacket(ProtocolInfo::ENTITY_EVENT_PACKET, EntityEventPacket::class); $this->registerPacket(ProtocolInfo::ENTITY_EVENT_PACKET, EntityEventPacket::class);
$this->registerPacket(ProtocolInfo::MOB_EQUIPMENT_PACKET, MobEquipmentPacket::class); $this->registerPacket(ProtocolInfo::MOB_EQUIPMENT_PACKET, MobEquipmentPacket::class);
$this->registerPacket(ProtocolInfo::MOB_ARMOR_EQUIPMENT_PACKET, MobArmorEquipmentPacket::class); $this->registerPacket(ProtocolInfo::MOB_ARMOR_EQUIPMENT_PACKET, MobArmorEquipmentPacket::class);
@ -349,7 +349,7 @@ class Network{
$this->registerPacket(ProtocolInfo::CRAFTING_DATA_PACKET, CraftingDataPacket::class); $this->registerPacket(ProtocolInfo::CRAFTING_DATA_PACKET, CraftingDataPacket::class);
$this->registerPacket(ProtocolInfo::CRAFTING_EVENT_PACKET, CraftingEventPacket::class); $this->registerPacket(ProtocolInfo::CRAFTING_EVENT_PACKET, CraftingEventPacket::class);
$this->registerPacket(ProtocolInfo::ADVENTURE_SETTINGS_PACKET, AdventureSettingsPacket::class); $this->registerPacket(ProtocolInfo::ADVENTURE_SETTINGS_PACKET, AdventureSettingsPacket::class);
$this->registerPacket(ProtocolInfo::TILE_ENTITY_DATA_PACKET, TileEntityDataPacket::class); $this->registerPacket(ProtocolInfo::BLOCK_ENTITY_DATA_PACKET, BlockEntityDataPacket::class);
$this->registerPacket(ProtocolInfo::FULL_CHUNK_DATA_PACKET, FullChunkDataPacket::class); $this->registerPacket(ProtocolInfo::FULL_CHUNK_DATA_PACKET, FullChunkDataPacket::class);
$this->registerPacket(ProtocolInfo::SET_DIFFICULTY_PACKET, SetDifficultyPacket::class); $this->registerPacket(ProtocolInfo::SET_DIFFICULTY_PACKET, SetDifficultyPacket::class);
$this->registerPacket(ProtocolInfo::PLAYER_LIST_PACKET, PlayerListPacket::class); $this->registerPacket(ProtocolInfo::PLAYER_LIST_PACKET, PlayerListPacket::class);

View File

@ -24,8 +24,8 @@ namespace pocketmine\network\protocol;
#include <rules/DataPacket.h> #include <rules/DataPacket.h>
class TileEntityDataPacket extends DataPacket{ class BlockEntityDataPacket extends DataPacket{
const NETWORK_ID = Info::TILE_ENTITY_DATA_PACKET; const NETWORK_ID = Info::BLOCK_ENTITY_DATA_PACKET;
public $x; public $x;
public $y; public $y;

View File

@ -24,8 +24,8 @@ namespace pocketmine\network\protocol;
#include <rules/DataPacket.h> #include <rules/DataPacket.h>
class TileEventPacket extends DataPacket{ class BlockEventPacket extends DataPacket{
const NETWORK_ID = Info::TILE_EVENT_PACKET; const NETWORK_ID = Info::BLOCK_EVENT_PACKET;
public $x; public $x;
public $y; public $y;

View File

@ -30,12 +30,14 @@ class ContainerSetSlotPacket extends DataPacket{
public $windowid; public $windowid;
public $slot; public $slot;
public $hotbarSlot;
/** @var Item */ /** @var Item */
public $item; public $item;
public function decode(){ public function decode(){
$this->windowid = $this->getByte(); $this->windowid = $this->getByte();
$this->slot = $this->getShort(); $this->slot = $this->getShort();
$this->hotboarSlot = $this->getShort();
$this->item = $this->getSlot(); $this->item = $this->getSlot();
} }
@ -43,6 +45,7 @@ class ContainerSetSlotPacket extends DataPacket{
$this->reset(); $this->reset();
$this->putByte($this->windowid); $this->putByte($this->windowid);
$this->putShort($this->slot); $this->putShort($this->slot);
$this->putShort($this->hotbarSlot);
$this->putSlot($this->item); $this->putSlot($this->item);
} }

View File

@ -30,7 +30,7 @@ interface Info{
/** /**
* Actual Minecraft: PE protocol version * Actual Minecraft: PE protocol version
*/ */
const CURRENT_PROTOCOL = 34; const CURRENT_PROTOCOL = 38;
const LOGIN_PACKET = 0x8f; const LOGIN_PACKET = 0x8f;
const PLAY_STATUS_PACKET = 0x90; const PLAY_STATUS_PACKET = 0x90;
@ -52,7 +52,7 @@ interface Info{
const ADD_PAINTING_PACKET = 0xa0; const ADD_PAINTING_PACKET = 0xa0;
const EXPLODE_PACKET = 0xa1; const EXPLODE_PACKET = 0xa1;
const LEVEL_EVENT_PACKET = 0xa2; const LEVEL_EVENT_PACKET = 0xa2;
const TILE_EVENT_PACKET = 0xa3; const BLOCK_EVENT_PACKET = 0xa3;
const ENTITY_EVENT_PACKET = 0xa4; const ENTITY_EVENT_PACKET = 0xa4;
const MOB_EFFECT_PACKET = 0xa5; const MOB_EFFECT_PACKET = 0xa5;
const UPDATE_ATTRIBUTES_PACKET = 0xa6; const UPDATE_ATTRIBUTES_PACKET = 0xa6;
@ -78,7 +78,7 @@ interface Info{
const CRAFTING_DATA_PACKET = 0xba; const CRAFTING_DATA_PACKET = 0xba;
const CRAFTING_EVENT_PACKET = 0xbb; const CRAFTING_EVENT_PACKET = 0xbb;
const ADVENTURE_SETTINGS_PACKET = 0xbc; const ADVENTURE_SETTINGS_PACKET = 0xbc;
const TILE_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;
@ -86,7 +86,7 @@ interface Info{
//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
} }

View File

@ -52,6 +52,7 @@ class LoginPacket extends DataPacket{
$this->serverAddress = $this->getString(); $this->serverAddress = $this->getString();
$this->clientSecret = $this->getString(); $this->clientSecret = $this->getString();
$this->getByte(); // TODO: skin transparency, experimental or not?
$this->slim = $this->getByte() > 0; $this->slim = $this->getByte() > 0;
$this->skin = $this->getString(); $this->skin = $this->getString();
} }

View File

@ -53,6 +53,7 @@ class PlayerListPacket extends DataPacket{
$this->putUUID($d[0]); $this->putUUID($d[0]);
$this->putLong($d[1]); $this->putLong($d[1]);
$this->putString($d[2]); $this->putString($d[2]);
$this->putByte(0); // TODO: skin transparency, experimental or not?
$this->putByte($d[3] ? 1 : 0); $this->putByte($d[3] ? 1 : 0);
$this->putString($d[4]); $this->putString($d[4]);
}else{ }else{