diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 152b8424..bc21a10f 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -95,6 +95,13 @@ public class ServerConnector extends PacketHandler user.getServer().disconnect( "Quitting" ); } + // TODO: Fix this? + if ( !user.ch.isActive() ) + { + server.disconnect( "Quitting" ); + throw new IllegalStateException( "No client connected for pending server!" ); + } + // Add to new server // TODO: Move this to the connected() method of DownstreamBridge target.addPlayer( user ); 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 1d4223c1..b724b14a 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 @@ -13,7 +13,6 @@ import net.md_5.bungee.Util; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; -import net.md_5.bungee.api.connection.Server; import net.md_5.bungee.api.event.ChatEvent; import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.packet.Packet0KeepAlive; @@ -44,8 +43,9 @@ public class DownstreamBridge extends PacketHandler server.getInfo().removePlayer( con ); bungee.getReconnectHandler().setServer( con ); - if (!server.isObsolete()){ - con.disconnect( "[Proxy] Lost connection to server D:" ); + if ( !server.isObsolete() ) + { + con.disconnect( "[Proxy] Lost connection to server D:" ); } }