RakLibInterface: Log a message when a non-0xfe packet is received

This commit is contained in:
Dylan K. Taylor 2021-06-15 19:20:31 +01:00
parent 2ee86f0edf
commit c22f793521
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -44,6 +44,7 @@ use raklib\server\ipc\UserToRakLibThreadMessageSender;
use raklib\server\ServerEventListener;
use raklib\utils\InternetAddress;
use function addcslashes;
use function base64_encode;
use function bin2hex;
use function implode;
use function mt_rand;
@ -176,6 +177,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{
public function onPacketReceive(int $sessionId, string $packet) : void{
if(isset($this->sessions[$sessionId])){
if($packet === "" or $packet[0] !== self::MCPE_RAKNET_PACKET_ID){
$this->sessions[$sessionId]->getLogger()->debug("Non-FE packet received: " . base64_encode($packet));
return;
}
//get this now for blocking in case the player was closed before the exception was raised