Handle when user gets kicked midway through login to other server

This commit is contained in:
md_5 2013-03-11 09:47:42 +11:00
parent 6ae5feee60
commit cfd10f5714
2 changed files with 10 additions and 3 deletions

View File

@ -95,6 +95,13 @@ public class ServerConnector extends PacketHandler
user.getServer().disconnect( "Quitting" ); 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 // Add to new server
// TODO: Move this to the connected() method of DownstreamBridge // TODO: Move this to the connected() method of DownstreamBridge
target.addPlayer( user ); target.addPlayer( user );

View File

@ -13,7 +13,6 @@ import net.md_5.bungee.Util;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer; 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.ChatEvent;
import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.packet.Packet0KeepAlive; import net.md_5.bungee.packet.Packet0KeepAlive;
@ -44,7 +43,8 @@ public class DownstreamBridge extends PacketHandler
server.getInfo().removePlayer( con ); server.getInfo().removePlayer( con );
bungee.getReconnectHandler().setServer( con ); bungee.getReconnectHandler().setServer( con );
if (!server.isObsolete()){ if ( !server.isObsolete() )
{
con.disconnect( "[Proxy] Lost connection to server D:" ); con.disconnect( "[Proxy] Lost connection to server D:" );
} }
} }