summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-15 05:52:46 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-15 05:52:46 +0000
commitb3698055902c3dddea53f3e03cea791b60ab0e20 (patch)
treed40dcdfc23ef1fef376700c7dbdf88944d5cfed8 /src/main
parentdfbcd36ab7b0f7e8d26ca256b789509f0fc5a6fb (diff)
downloadcraftbukkit-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')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java5
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;