mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 11:15:47 +01:00
Handle when user gets kicked midway through login to other server
This commit is contained in:
parent
6ae5feee60
commit
cfd10f5714
@ -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 );
|
||||||
|
@ -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:" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user