diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-15 05:52:46 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-15 05:52:46 +0000 |
commit | b3698055902c3dddea53f3e03cea791b60ab0e20 (patch) | |
tree | d40dcdfc23ef1fef376700c7dbdf88944d5cfed8 /src/main/java/net/minecraft/server/NetServerHandler.java | |
parent | dfbcd36ab7b0f7e8d26ca256b789509f0fc5a6fb (diff) | |
download | craftbukkit-b3698055902c3dddea53f3e03cea791b60ab0e20.tar craftbukkit-b3698055902c3dddea53f3e03cea791b60ab0e20.tar.gz craftbukkit-b3698055902c3dddea53f3e03cea791b60ab0e20.tar.lz craftbukkit-b3698055902c3dddea53f3e03cea791b60ab0e20.tar.xz craftbukkit-b3698055902c3dddea53f3e03cea791b60ab0e20.zip |
Don't allow players with modded clients to send empty (0 char) chat messages. Thanks to a PR by robin0van0der0v
Diffstat (limited to 'src/main/java/net/minecraft/server/NetServerHandler.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 9f98355e..f0cb509e 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -724,6 +724,11 @@ public class NetServerHandler extends NetHandler implements ICommandListener { public boolean chat(String s) { if (!this.player.dead) { + if (s.length() == 0) { + a.warning(this.player.name + " tried to send an empty message"); + return false; + } + if (s.startsWith("/")) { this.handleCommand(s); return true; |