mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Merge branch 'minor-next' into major-next
This commit is contained in:
@ -199,6 +199,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{
|
||||
$session = $this->sessions[$sessionId];
|
||||
$address = $session->getIp();
|
||||
$buf = substr($packet, 1);
|
||||
$name = $session->getDisplayName();
|
||||
try{
|
||||
$session->handleEncoded($buf);
|
||||
}catch(PacketHandlingException $e){
|
||||
@ -209,6 +210,10 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{
|
||||
$logger->debug(implode("\n", Utils::printableExceptionInfo($e)));
|
||||
$session->disconnectWithError(KnownTranslationFactory::pocketmine_disconnect_error_badPacket());
|
||||
$this->interface->blockAddress($address, 5);
|
||||
}catch(\Throwable $e){
|
||||
//record the name of the player who caused the crash, to make it easier to find the reproducing steps
|
||||
$this->server->getLogger()->emergency("Crash occurred while handling a packet from session: $name");
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user