mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Added server.unknownpacket to receive unknown packets
This commit is contained in:
parent
4e8e132fcf
commit
cdc164729c
@ -78,8 +78,14 @@ class MinecraftInterface{
|
||||
}
|
||||
$pid = ord($buf{0});
|
||||
$struct = $this->getStruct($pid);
|
||||
if($struct === false){
|
||||
console("[ERROR] Unknown Packet ID 0x".Utils::strToHex(chr($pid)), true, true, 0);
|
||||
if($struct === false and ServerAPI::request()->api->dhandle("server.unknownpacket", array(
|
||||
"pid" => $pid,
|
||||
"data" => array(),
|
||||
"raw" => $buf,
|
||||
"ip" => $source,
|
||||
"port" => $port
|
||||
)) !== true){
|
||||
console("[ERROR] Unknown 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))." [length ".strlen($buf)."]".PHP_EOL;
|
||||
$p .= Utils::hexdump($buf);
|
||||
$p .= PHP_EOL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user