From 76319371f7b0c5ca981632ca90099d5eb02dfd13 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 11 Mar 2013 10:06:14 +1100 Subject: [PATCH] Small code / api cleanup. Need to fix kicking in general, especially in ServerConnector before release. --- .../net/md_5/bungee/api/connection/PendingConnection.java | 8 -------- .../net/md_5/bungee/api/connection/ProxiedPlayer.java | 7 ------- proxy/src/main/java/net/md_5/bungee/Logger.java | 3 +-- proxy/src/main/java/net/md_5/bungee/ServerConnection.java | 2 -- proxy/src/main/java/net/md_5/bungee/UserConnection.java | 1 - .../java/net/md_5/bungee/connection/InitialHandler.java | 4 ++-- .../main/java/net/md_5/bungee/netty/PipelineUtils.java | 3 --- 7 files changed, 3 insertions(+), 25 deletions(-) diff --git a/api/src/main/java/net/md_5/bungee/api/connection/PendingConnection.java b/api/src/main/java/net/md_5/bungee/api/connection/PendingConnection.java index 4c952f37..0334afc6 100644 --- a/api/src/main/java/net/md_5/bungee/api/connection/PendingConnection.java +++ b/api/src/main/java/net/md_5/bungee/api/connection/PendingConnection.java @@ -30,14 +30,6 @@ public interface PendingConnection extends Connection */ public InetSocketAddress getVirtualHost(); - /** - * Completely kick this user from the proxy and all of its child - * connections. - * - * @param reason the disconnect reason displayed to the player - */ - public void disconnect(String reason); - /** * Get the listener that accepted this connection. * diff --git a/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java b/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java index 0cc70ab0..b0e45598 100644 --- a/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java +++ b/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java @@ -48,13 +48,6 @@ public interface ProxiedPlayer extends Connection, CommandSender */ public int getPing(); - /** - * Disconnect (remove) this player from the proxy with the specified reason. - * - * @param reason the reason displayed to the player - */ - public void disconnect(String reason); - /** * Send a plugin message to this player. * diff --git a/proxy/src/main/java/net/md_5/bungee/Logger.java b/proxy/src/main/java/net/md_5/bungee/Logger.java index 76190f3c..aa38547d 100644 --- a/proxy/src/main/java/net/md_5/bungee/Logger.java +++ b/proxy/src/main/java/net/md_5/bungee/Logger.java @@ -3,7 +3,6 @@ package net.md_5.bungee; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import java.text.MessageFormat; import java.text.SimpleDateFormat; import java.util.logging.FileHandler; import java.util.logging.Formatter; @@ -21,7 +20,7 @@ public class Logger extends java.util.logging.Logger public Logger() { - super( "RubberBand", null ); + super( "BungeeCord", null ); try { FileHandler handler = new FileHandler( "proxy.log", 1 << 14, 1, true ); diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnection.java b/proxy/src/main/java/net/md_5/bungee/ServerConnection.java index 9a424b98..6a55e2c9 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnection.java @@ -1,8 +1,6 @@ package net.md_5.bungee; import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelFutureListener; import java.net.InetSocketAddress; import java.util.concurrent.TimeUnit; import lombok.Getter; diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 8fa7589b..be29988a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -23,7 +23,6 @@ import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.PendingConnection; import net.md_5.bungee.api.connection.ProxiedPlayer; -import net.md_5.bungee.api.event.PlayerDisconnectEvent; import net.md_5.bungee.api.event.ServerConnectEvent; import net.md_5.bungee.netty.HandlerBoss; import net.md_5.bungee.netty.PipelineUtils; diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index 8466d619..08eae435 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -184,9 +184,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection ch.pipeline().addBefore( "decoder", "cipher", new CipherCodec( encrypt, decrypt ) ); thisState = InitialHandler.State.LOGIN; - } catch ( Exception ex ) + } catch ( Throwable t ) { - disconnect( "[Report to md_5 / Server Owner] " + Util.exception( ex ) ); + disconnect( "[Report to md_5 / Server Owner] " + Util.exception( t ) ); } } }.start(); diff --git a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java index f5f7e443..0e128da1 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java @@ -1,13 +1,10 @@ package net.md_5.bungee.netty; -import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; import io.netty.channel.ChannelConfig; import io.netty.channel.ChannelException; -import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; -import io.netty.channel.ChannelOutboundMessageHandlerAdapter; import io.netty.handler.timeout.ReadTimeoutHandler; import io.netty.util.AttributeKey; import java.util.concurrent.TimeUnit;