mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
Merge branch 'release/3.3'
This commit is contained in:
commit
e13764832d
@ -136,16 +136,18 @@ class RakLibInterface implements ServerInstance, AdvancedNetworkInterface{
|
||||
public function handleEncapsulated(string $identifier, EncapsulatedPacket $packet, int $flags) : void{
|
||||
if(isset($this->sessions[$identifier])){
|
||||
//get this now for blocking in case the player was closed before the exception was raised
|
||||
$address = $this->sessions[$identifier]->getIp();
|
||||
$session = $this->sessions[$identifier];
|
||||
$address = $session->getIp();
|
||||
try{
|
||||
if($packet->buffer !== "" and $packet->buffer{0} === self::MCPE_RAKNET_PACKET_ID){ //Batch
|
||||
$this->sessions[$identifier]->handleEncoded(substr($packet->buffer, 1));
|
||||
$session->handleEncoded(substr($packet->buffer, 1));
|
||||
}
|
||||
}catch(\Throwable $e){
|
||||
$logger = $this->server->getLogger();
|
||||
$logger->debug("EncapsulatedPacket 0x" . bin2hex($packet->buffer));
|
||||
$logger->logException($e);
|
||||
|
||||
$session->disconnect("Internal server error");
|
||||
$this->interface->blockAddress($address, 5);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user