New packet

This commit is contained in:
Shoghi Cervantes Pueyo 2012-10-25 19:08:36 +02:00
parent 60c80110d3
commit 14e6fcb24e
5 changed files with 47 additions and 23 deletions

View file

@ -79,7 +79,8 @@ class MinecraftInterface{
}*/
$struct = $this->getStruct($pid);
if($struct === false){
$p = "[".microtime(true)."] [SERVER->CLIENT]: Error, bad packet id 0x".Utils::strToHex(chr($pid)).PHP_EOL;
console("[ERROR] Bad packet id 0x".Utils::strTohex(chr($pid)), true, true, 0);
$p = "[".microtime(true)."] [".((($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 .= Utils::hexdump($data[0]);
$p .= PHP_EOL;
logg($p, "packets", true, 2);