From 1727e18e31cb79b810e10c8761c69fdb3944668f Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 4 Jul 2013 20:24:13 +0200 Subject: [PATCH] Updated for Minecraft: PE 0.7.2 --- src/Player.php | 13 +++++++++++-- src/PocketMinecraftServer.php | 1 + src/config.php | 4 ++-- src/material/block/solid/BurningFurnace.php | 2 +- src/material/block/solid/Chest.php | 2 +- src/network/ProtocolInfo.php | 5 +++++ 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Player.php b/src/Player.php index 95fe7b01..12ddb643 100644 --- a/src/Player.php +++ b/src/Player.php @@ -454,7 +454,8 @@ class Player{ case "player.armor": if($data["player"]->level === $this->level){ if($data["eid"] === $this->eid){ - $data["eid"] = 0; + $this->sendArmor($this); + break; } $this->dataPacket(MC_PLAYER_ARMOR_EQUIPMENT, $data); } @@ -1709,7 +1710,15 @@ class Player{ } } if($player instanceof Player){ - $player->dataPacket(MC_PLAYER_ARMOR_EQUIPMENT, $data); + if($player === $this){ + $this->dataPacket(MC_CONTAINER_SET_CONTENT, array( + "windowid" => 0x78, + "count" => 4, + "slots" => $this->armor, + )); + }else{ + $player->dataPacket(MC_PLAYER_ARMOR_EQUIPMENT, $data); + } }else{ $this->server->api->dhandle("player.armor", $data); } diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index 0aed334c..e67c2d8b 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -476,6 +476,7 @@ class PocketMinecraftServer{ return; } switch($packet["pid"]){ + case 0x01: case 0x02: if($this->invisible === true){ $this->send(0x1c, array( diff --git a/src/config.php b/src/config.php index 7f3bcbb9..70b788d6 100644 --- a/src/config.php +++ b/src/config.php @@ -65,8 +65,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH); ini_set("memory_limit", "128M"); //Default define("LOG", true); define("START_TIME", microtime(true)); -define("MAJOR_VERSION", "Alpha_1.3.3dev"); -define("CURRENT_MINECRAFT_VERSION", "0.7.1 alpha"); +define("MAJOR_VERSION", "Alpha_1.3.3"); +define("CURRENT_MINECRAFT_VERSION", "0.7.3 alpha"); define("CURRENT_API_VERSION", 9); define("CURRENT_PHP_VERSION", "5.5"); $gitsha1 = false; diff --git a/src/material/block/solid/BurningFurnace.php b/src/material/block/solid/BurningFurnace.php index 76623222..de60a893 100644 --- a/src/material/block/solid/BurningFurnace.php +++ b/src/material/block/solid/BurningFurnace.php @@ -69,7 +69,7 @@ class BurningFurnaceBlock extends SolidBlock{ return true; } $player->windowCnt++; - $player->windowCnt = $id = max(2, $player->windowCnt % 255); + $player->windowCnt = $id = max(2, $player->windowCnt % 16); $player->windows[$id] = $furnace; $player->dataPacket(MC_CONTAINER_OPEN, array( "windowid" => $id, diff --git a/src/material/block/solid/Chest.php b/src/material/block/solid/Chest.php index ed55f8b2..c32bf0fd 100644 --- a/src/material/block/solid/Chest.php +++ b/src/material/block/solid/Chest.php @@ -87,7 +87,7 @@ class ChestBlock extends TransparentBlock{ return true; } $player->windowCnt++; - $player->windowCnt = $id = max(2, $player->windowCnt % 255); + $player->windowCnt = $id = max(2, $player->windowCnt % 16); $player->windows[$id] = $chest; $player->dataPacket(MC_CONTAINER_OPEN, array( "windowid" => $id, diff --git a/src/network/ProtocolInfo.php b/src/network/ProtocolInfo.php index ff81dc87..6de463d2 100644 --- a/src/network/ProtocolInfo.php +++ b/src/network/ProtocolInfo.php @@ -171,6 +171,7 @@ class Protocol{ ); public static $packetName = array( + 0x01 => "ID_CONNECTED_PING_OPEN_CONNECTIONS", //RakNet 0x02 => "ID_UNCONNECTED_PING_OPEN_CONNECTIONS", //RakNet 0x05 => "ID_OPEN_CONNECTION_REQUEST_1", //RakNet 0x06 => "ID_OPEN_CONNECTION_REPLY_1", //RakNet @@ -188,6 +189,10 @@ class Protocol{ ); public static $raknet = array( + 0x01 => array( + "long", //Ping ID + "magic", + ), 0x02 => array( "long", //Ping ID "magic",