diff --git a/classes/CustomPacketHandler.class.php b/classes/CustomPacketHandler.class.php index 1e0676df3..401903aca 100644 --- a/classes/CustomPacketHandler.class.php +++ b/classes/CustomPacketHandler.class.php @@ -68,9 +68,9 @@ class CustomPacketHandler{ break; case 0x85: if($this->c === false){ - $this->data["message"] = $this->get(ord($this->get(1))); + $this->data["message"] = $this->get(Utils::readShort($this->get(2), false)); }else{ - $this->raw .= chr(strlen($this->data["message"])).$this->data["message"]; + $this->raw .= Utils::writeShort(strlen($this->data["message"])).$this->data["message"]; } break; case 0x86: @@ -99,6 +99,13 @@ class CustomPacketHandler{ $this->raw .= Utils::writeFloat($this->data["z"]); } break; + case 0xb1: + if($this->c === false){ + $this->data["message"] = $this->get(Utils::readShort($this->get(2), false)); + }else{ + $this->raw .= Utils::writeShort(strlen($this->data["message"])).$this->data["message"]; + } + break; case 0x09: if($this->c === false){ $this->data["clientID"] = $this->get(8); diff --git a/classes/PocketMinecraftClient.class.php b/classes/PocketMinecraftClient.class.php index 048452396..d4b4aa60a 100644 --- a/classes/PocketMinecraftClient.class.php +++ b/classes/PocketMinecraftClient.class.php @@ -129,17 +129,6 @@ class PocketMinecraftClient{ $this->send(0xc0, array(1, true, $data[0])); } switch($data["id"]){ - case 0x00: - $this->send(0x84, array( - $this->counter[0], - 0x00, - array( - "id" => 0x00, - "payload" => $data["payload"], - ), - )); - ++$this->counter[0]; - break; case 0x10: $this->send(0x84, array( $this->counter[0], @@ -161,6 +150,15 @@ class PocketMinecraftClient{ ), )); ++$this->counter[0]; + $this->send(0x84, array( + $this->counter[0], + 0x00, + array( + "id" => 0xb1, + "message" => $this->username, + ), + )); + ++$this->counter[0]; break; case 0x86: console("[DEBUG] Time: ".$data["time"], true, true, 2);