Fix kicks - that was easy

This commit is contained in:
md_5 2013-02-18 18:35:33 +11:00
parent ce9766aae4
commit c44dc7931a

View File

@ -12,6 +12,7 @@ import net.md_5.bungee.packet.DefinedPacket;
import net.md_5.bungee.packet.Packet1Login; import net.md_5.bungee.packet.Packet1Login;
import net.md_5.bungee.packet.PacketCDClientStatus; import net.md_5.bungee.packet.PacketCDClientStatus;
import net.md_5.bungee.packet.PacketFDEncryptionRequest; 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.PacketHandler;
import net.md_5.bungee.packet.PacketStream; import net.md_5.bungee.packet.PacketStream;
@ -48,6 +49,12 @@ public class ServerConnector extends PacketHandler
thisState = State.LOGIN; 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) public static ServerConnection connect(UserConnection user, ServerInfo info, boolean retry)
{ {
Socket socket = null; Socket socket = null;
@ -99,6 +106,10 @@ public class ServerConnector extends PacketHandler
return connect( user, def, false ); return connect( user, def, false );
} else } else
{ {
if ( ex instanceof KickException )
{
throw (KickException) ex;
}
throw new RuntimeException( "Could not connect to target server " + Util.exception( ex ) ); throw new RuntimeException( "Could not connect to target server " + Util.exception( ex ) );
} }
} }