mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +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{
|
public function handleEncapsulated(string $identifier, EncapsulatedPacket $packet, int $flags) : void{
|
||||||
if(isset($this->sessions[$identifier])){
|
if(isset($this->sessions[$identifier])){
|
||||||
//get this now for blocking in case the player was closed before the exception was raised
|
//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{
|
try{
|
||||||
if($packet->buffer !== "" and $packet->buffer{0} === self::MCPE_RAKNET_PACKET_ID){ //Batch
|
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){
|
}catch(\Throwable $e){
|
||||||
$logger = $this->server->getLogger();
|
$logger = $this->server->getLogger();
|
||||||
$logger->debug("EncapsulatedPacket 0x" . bin2hex($packet->buffer));
|
$logger->debug("EncapsulatedPacket 0x" . bin2hex($packet->buffer));
|
||||||
$logger->logException($e);
|
$logger->logException($e);
|
||||||
|
|
||||||
|
$session->disconnect("Internal server error");
|
||||||
$this->interface->blockAddress($address, 5);
|
$this->interface->blockAddress($address, 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user