summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-20 16:03:15 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-20 16:03:15 +0000
commit51a056ecd5820ff24a87f0c20a05024f68275224 (patch)
tree3d2773baa9e22322d945732983d604b79e56eea6 /src/main/java/net/minecraft/server
parent76d7a1ce1d88ba8546e8f4da3e8fcb9104d03b7d (diff)
downloadcraftbukkit-51a056ecd5820ff24a87f0c20a05024f68275224.tar
craftbukkit-51a056ecd5820ff24a87f0c20a05024f68275224.tar.gz
craftbukkit-51a056ecd5820ff24a87f0c20a05024f68275224.tar.lz
craftbukkit-51a056ecd5820ff24a87f0c20a05024f68275224.tar.xz
craftbukkit-51a056ecd5820ff24a87f0c20a05024f68275224.zip
Disallow colour names in offline-mode. This fixes BUKKIT-439. Thanks to cainfool for the discovery.
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/NetLoginHandler.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetLoginHandler.java b/src/main/java/net/minecraft/server/NetLoginHandler.java
index e3494c05..82e3804c 100644
--- a/src/main/java/net/minecraft/server/NetLoginHandler.java
+++ b/src/main/java/net/minecraft/server/NetLoginHandler.java
@@ -6,6 +6,7 @@ import java.util.Random;
import java.util.logging.Logger;
// CraftBukkit start
+import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.server.ServerListPingEvent;
// CraftBukkit end
@@ -77,6 +78,12 @@ public class NetLoginHandler extends NetHandler {
}
} else {
if (!this.server.onlineMode) {
+ // CraftBukkit start - disallow colour in names
+ if (!packet1login.name.equals(ChatColor.stripColor(packet1login.name))) {
+ this.disconnect("Colourful names are not permitted!");
+ return;
+ }
+ // CraftBukkit end
this.b(packet1login);
} else {
(new ThreadLoginVerifier(this, packet1login, this.server.server)).start(); // CraftBukkit