Typo in length

This commit is contained in:
Shoghi Cervantes Pueyo 2012-11-23 15:50:16 +01:00
parent 7c25b8c614
commit 6b12832b02
3 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;