mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-28 19:47:49 +01:00
Fix kicks - that was easy
This commit is contained in:
parent
ce9766aae4
commit
c44dc7931a
@ -12,6 +12,7 @@ import net.md_5.bungee.packet.DefinedPacket;
|
||||
import net.md_5.bungee.packet.Packet1Login;
|
||||
import net.md_5.bungee.packet.PacketCDClientStatus;
|
||||
import net.md_5.bungee.packet.PacketFDEncryptionRequest;
|
||||
import net.md_5.bungee.packet.PacketFFKick;
|
||||
import net.md_5.bungee.packet.PacketHandler;
|
||||
import net.md_5.bungee.packet.PacketStream;
|
||||
|
||||
@ -48,6 +49,12 @@ public class ServerConnector extends PacketHandler
|
||||
thisState = State.LOGIN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(PacketFFKick kick) throws Exception
|
||||
{
|
||||
throw new KickException( kick.message );
|
||||
}
|
||||
|
||||
public static ServerConnection connect(UserConnection user, ServerInfo info, boolean retry)
|
||||
{
|
||||
Socket socket = null;
|
||||
@ -99,6 +106,10 @@ public class ServerConnector extends PacketHandler
|
||||
return connect( user, def, false );
|
||||
} else
|
||||
{
|
||||
if ( ex instanceof KickException )
|
||||
{
|
||||
throw (KickException) ex;
|
||||
}
|
||||
throw new RuntimeException( "Could not connect to target server " + Util.exception( ex ) );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user