Merge branch 'minor-next' into major-next

This commit is contained in:
Dylan K. Taylor
2023-03-29 23:22:02 +01:00
8 changed files with 81 additions and 13 deletions

View File

@ -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;
}
}
}