From 227301ec731c08c23466f2ffa54ddce3603dee55 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 13 Mar 2014 07:40:12 +1100 Subject: [PATCH] Don't throw full exception on bad magic --- query/src/main/java/net/md_5/bungee/query/QueryHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java index 91a614e6..d9460914 100644 --- a/query/src/main/java/net/md_5/bungee/query/QueryHandler.java +++ b/query/src/main/java/net/md_5/bungee/query/QueryHandler.java @@ -11,6 +11,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Random; import java.util.concurrent.TimeUnit; +import java.util.logging.Level; import lombok.RequiredArgsConstructor; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ListenerInfo; @@ -51,7 +52,8 @@ public class QueryHandler extends SimpleChannelInboundHandler ByteBuf in = msg.content(); if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) { - throw new IllegalStateException( "Incorrect magic!" ); + bungee.getLogger().log( Level.WARNING, "Query - Incorrect magic!: {0}", msg.sender() ); + return; } ByteBuf out = ctx.alloc().buffer();