From 91b673e375ee08791b15f5d9c153c28fa6c718eb Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Mon, 28 Nov 2011 06:21:35 +0000 Subject: [PATCH] Ignore empty messages (not just null) for join and quit --- src/main/java/net/minecraft/server/NetServerHandler.java | 2 +- .../java/net/minecraft/server/ServerConfigurationManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 81b541bbf7..2d7abfaa0c 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -648,7 +648,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { a.info(this.player.name + " lost connection: " + s); // CraftBukkit start - we need to handle custom quit messages String quitMessage = this.minecraftServer.serverConfigurationManager.disconnect(this.player); - if (quitMessage != null) { + if ((quitMessage != null) && (quitMessage.length() > 0)) { this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat(quitMessage)); } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index 51a8b76385..f5beefb7e5 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -130,7 +130,7 @@ public class ServerConfigurationManager { String joinMessage = playerJoinEvent.getJoinMessage(); - if (joinMessage != null) { + if ((joinMessage != null) && (joinMessage.length() > 0)) { this.server.serverConfigurationManager.sendAll(new Packet3Chat(joinMessage)); } // CraftBukkit end