From a9ad4889f792f238f1854b8c0fbb359da2a2e0af Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 13 Apr 2013 18:28:11 +1000 Subject: [PATCH] Revert "Bungee join / part messages" This reverts commit 7108bd4deb3c5ae4c9ea49b0c82097fe5b3942b1. --- .../java/net/md_5/bungee/api/ProxyServer.java | 7 ------- .../main/java/net/md_5/bungee/BungeeCord.java | 9 --------- .../java/net/md_5/bungee/UserConnection.java | 16 ++-------------- .../net/md_5/bungee/config/Configuration.java | 8 +------- 4 files changed, 3 insertions(+), 37 deletions(-) diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyServer.java b/api/src/main/java/net/md_5/bungee/api/ProxyServer.java index 4ecadcd9..d556869e 100644 --- a/api/src/main/java/net/md_5/bungee/api/ProxyServer.java +++ b/api/src/main/java/net/md_5/bungee/api/ProxyServer.java @@ -247,11 +247,4 @@ public abstract class ProxyServer * @return the server's {@link AsyncHttpClient} instance */ public abstract AsyncHttpClient getHttpClient(); - - /** - * Send a message to all connected players. - * - * @param message the message to send - */ - public abstract void broadcast(String message); } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index 22d6a3c2..7c1786fc 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -403,13 +403,4 @@ public class BungeeCord extends ProxyServer { return ConsoleCommandSender.getInstance(); } - - @Override - public void broadcast(String message) - { - for ( ProxiedPlayer player : getPlayers() ) - { - player.sendMessage( message ); - } - } } 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 0d92b13e..07d5ab4a 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -10,7 +10,6 @@ import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.socket.nio.NioSocketChannel; import java.net.InetSocketAddress; -import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -86,9 +85,6 @@ public final class UserConnection implements ProxiedPlayer { addGroups( s ); } - - //TODO: Here? - bungee.broadcast( MessageFormat.format( BungeeCord.getInstance().config.getJoinMessage(), getDisplayName() ) ); } public void sendPacket(DefinedPacket p) @@ -192,8 +188,6 @@ public final class UserConnection implements ProxiedPlayer { server.disconnect( "Quitting" ); } - - bungee.broadcast( MessageFormat.format( BungeeCord.getInstance().config.getPartMessage(), getDisplayName() ) ); } } @@ -201,19 +195,13 @@ public final class UserConnection implements ProxiedPlayer public void chat(String message) { Preconditions.checkState( server != null, "Not connected to server" ); - if ( message != null && !message.isEmpty() ) - { - server.getCh().write( new Packet3Chat( message ) ); - } + server.getCh().write( new Packet3Chat( message ) ); } @Override public void sendMessage(String message) { - if ( message != null && !message.isEmpty() ) - { - ch.write( new Packet3Chat( message ) ); - } + ch.write( new Packet3Chat( message ) ); } @Override diff --git a/proxy/src/main/java/net/md_5/bungee/config/Configuration.java b/proxy/src/main/java/net/md_5/bungee/config/Configuration.java index c8ea26ff..aacff219 100644 --- a/proxy/src/main/java/net/md_5/bungee/config/Configuration.java +++ b/proxy/src/main/java/net/md_5/bungee/config/Configuration.java @@ -5,7 +5,6 @@ import java.util.Collection; import java.util.Map; import java.util.UUID; import lombok.Getter; -import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ConfigurationAdapter; import net.md_5.bungee.api.config.ListenerInfo; @@ -50,8 +49,6 @@ public class Configuration */ private boolean onlineMode = true; private int playerLimit = -1; - private String joinMessage = "&b{0} has joined the network"; - private String partMessage = "&b{0} has left the network"; public void load() { @@ -63,10 +60,7 @@ public class Configuration onlineMode = adapter.getBoolean( "online_mode", onlineMode ); playerLimit = adapter.getInt( "player_limit", playerLimit ); - joinMessage = ChatColor.translateAlternateColorCodes( '&', adapter.getString( "messages.join", joinMessage ) ); - partMessage = ChatColor.translateAlternateColorCodes( '&', adapter.getString( "messages.part", partMessage ) ); - - DefaultTabList tab = DefaultTabList.valueOf( adapter.getString( "tab_list", "GLOBAL_PING" ).toUpperCase() ); + DefaultTabList tab = DefaultTabList.valueOf( adapter.getString( "tab_list", "GLOBAL_PING" ) ); if ( tab == null ) { tab = DefaultTabList.GLOBAL_PING;