From 6b12832b020d78bceb1f3be1a39c844528136723 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Fri, 23 Nov 2012 15:50:16 +0100 Subject: [PATCH] Typo in length --- classes/CustomPacketHandler.class.php | 2 +- classes/MinecraftInterface.class.php | 4 ++-- classes/PocketMinecraftClient.class.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/CustomPacketHandler.class.php b/classes/CustomPacketHandler.class.php index b6b86d573..5cc21c358 100644 --- a/classes/CustomPacketHandler.class.php +++ b/classes/CustomPacketHandler.class.php @@ -66,7 +66,7 @@ class CustomPacketHandler{ $id = ord($this->get(1)); $raw = $this->get($len - 1); $pk = new CustomPacketHandler($id, $raw); - $pk->data["lenght"] = $len; + $pk->data["length"] = $len; $pk->data["id"] = $id; $pk->data["counter"] = $c; $pk->data["packetName"] = $pk->name; diff --git a/classes/MinecraftInterface.class.php b/classes/MinecraftInterface.class.php index 9abedc851..afaea47f1 100644 --- a/classes/MinecraftInterface.class.php +++ b/classes/MinecraftInterface.class.php @@ -55,7 +55,7 @@ class MinecraftInterface{ protected function writeDump($pid, $raw, $data, $origin = "client", $ip = "", $port = 0){ if(LOG === true and DEBUG >= 2){ - $p = "[".(microtime(true) - $this->start)."] [".((($origin === "client" and $this->client === true) or ($origin === "server" and $this->client === false)) ? "CLIENT->SERVER":"SERVER->CLIENT")." ".$ip.":".$port."]: ".(isset($data["id"]) ? "MC Packet ".$this->dataName[$pid]:$this->name[$pid])." (0x".Utils::strTohex(chr($pid)).") [lenght ".strlen($raw)."]".PHP_EOL; + $p = "[".(microtime(true) - $this->start)."] [".((($origin === "client" and $this->client === true) or ($origin === "server" and $this->client === false)) ? "CLIENT->SERVER":"SERVER->CLIENT")." ".$ip.":".$port."]: ".(isset($data["id"]) ? "MC Packet ".$this->dataName[$pid]:$this->name[$pid])." (0x".Utils::strTohex(chr($pid)).") [length ".strlen($raw)."]".PHP_EOL; $p .= Utils::hexdump($raw); if(is_array($data)){ foreach($data as $i => $d){ @@ -88,7 +88,7 @@ class MinecraftInterface{ $struct = $this->getStruct($pid); if($struct === false){ console("[ERROR] Bad packet id 0x".Utils::strTohex(chr($pid)), true, true, 0); - $p = "[".(microtime(true) - $this->start)."] [".((($origin === "client" and $this->client === true) or ($origin === "server" and $this->client === false)) ? "CLIENT->SERVER":"SERVER->CLIENT")." ".$ip.":".$port."]: Error, bad packet id 0x".Utils::strTohex(chr($pid))." [lenght ".strlen($raw)."]".PHP_EOL; + $p = "[".(microtime(true) - $this->start)."] [".((($origin === "client" and $this->client === true) or ($origin === "server" and $this->client === false)) ? "CLIENT->SERVER":"SERVER->CLIENT")." ".$ip.":".$port."]: Error, bad packet id 0x".Utils::strTohex(chr($pid))." [length ".strlen($raw)."]".PHP_EOL; $p .= Utils::hexdump($data[0]); $p .= PHP_EOL; logg($p, "packets", true, 2); diff --git a/classes/PocketMinecraftClient.class.php b/classes/PocketMinecraftClient.class.php index 6d6b9975f..ebf90192c 100644 --- a/classes/PocketMinecraftClient.class.php +++ b/classes/PocketMinecraftClient.class.php @@ -101,12 +101,12 @@ class PocketMinecraftClient{ break; case 0x06: $serverID = $data[1]; - $lenght = $data[3]; + $length = $data[3]; $this->send(0x07, array( MAGIC, "\x04\x3f\x57\xfe\xfd", 19132, - $lenght, + $length, $this->clientID, )); break;