Use base64 instead of hex to display binary in some places

base64 takes less space than hex, which is beneficial for logging larger payloads.
This commit is contained in:
Dylan K. Taylor
2019-06-06 14:43:20 +01:00
parent 80f8a27094
commit eb161f8e1c
5 changed files with 8 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ namespace pocketmine\network\query;
use pocketmine\network\AdvancedSourceInterface;
use pocketmine\Server;
use pocketmine\utils\Binary;
use function bin2hex;
use function base64_encode;
use function chr;
use function hash;
use function microtime;
@@ -134,7 +134,7 @@ class QueryHandler{
$interface->sendRawPacket($address, $port, $reply);
break;
default:
$this->debug("Unhandled packet from $address $port: 0x" . bin2hex($packet));
$this->debug("Unhandled packet from $address $port: " . base64_encode($packet));
break;
}
}