From 3be83cb5a46374f0bd057fb943b5f25eb233e3b0 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 9 Mar 2013 17:59:44 +1100 Subject: [PATCH] Disconnect when exception caught --- .../java/net/md_5/bungee/connection/DownstreamBridge.java | 6 ++++++ .../java/net/md_5/bungee/connection/UpstreamBridge.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java index aa9a7ee4..50f5231f 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -29,6 +29,12 @@ public class DownstreamBridge extends PacketHandler private final UserConnection con; private final Server server; + @Override + public void exception(Throwable t) throws Exception + { + con.disconnect( Util.exception( t ) ); + } + @Override public void handle(ByteBuf buf) throws Exception { diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java index f099ce46..6d80ae5c 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -20,6 +20,12 @@ public class UpstreamBridge extends PacketHandler private final ProxyServer bungee; private final UserConnection con; + @Override + public void exception(Throwable t) throws Exception + { + con.disconnect( Util.exception( t ) ); + } + @Override public void handle(ByteBuf buf) throws Exception {