mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-27 12:46:05 +01:00
#2594: Add second way of catching exceptions when handling UDP query
This commit is contained in:
parent
96b1fb1f0e
commit
0dd538f9ff
@ -50,6 +50,17 @@ public class QueryHandler extends SimpleChannelInboundHandler<DatagramPacket>
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
handleMessage( ctx, msg );
|
||||
} catch ( Throwable t )
|
||||
{
|
||||
bungee.getLogger().log( Level.WARNING, "Error whilst handling query packet from " + msg.sender(), t );
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMessage(ChannelHandlerContext ctx, DatagramPacket msg)
|
||||
{
|
||||
ByteBuf in = msg.content();
|
||||
if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD )
|
||||
|
Loading…
Reference in New Issue
Block a user