mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-26 02:27:56 +01:00
Fix kicks + don't allow connections to online mode servers
This commit is contained in:
parent
2129cb3614
commit
e006673550
@ -23,6 +23,7 @@ import net.md_5.bungee.netty.PacketHandler;
|
||||
import net.md_5.bungee.protocol.MinecraftOutput;
|
||||
import net.md_5.bungee.protocol.DefinedPacket;
|
||||
import net.md_5.bungee.protocol.Protocol;
|
||||
import net.md_5.bungee.protocol.packet.EncryptionRequest;
|
||||
import net.md_5.bungee.protocol.packet.Login;
|
||||
import net.md_5.bungee.protocol.packet.Respawn;
|
||||
import net.md_5.bungee.protocol.packet.ScoreboardObjective;
|
||||
@ -188,6 +189,12 @@ public class ServerConnector extends PacketHandler
|
||||
throw new CancelSendSignal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(EncryptionRequest encryptionRequest) throws Exception
|
||||
{
|
||||
throw new RuntimeException( "Server is online mode!" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(Kick kick) throws Exception
|
||||
{
|
||||
|
@ -255,7 +255,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||
if ( ch.getHandle().isActive() )
|
||||
{
|
||||
bungee.getLogger().log( Level.INFO, "[" + getName() + "] disconnected with: " + reason );
|
||||
unsafe().sendPacket( new Kick( reason ) );
|
||||
unsafe().sendPacket( new Kick( BungeeCord.getInstance().gson.toJson( reason ) ) );
|
||||
ch.close();
|
||||
if ( server != null )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user