mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 05:25:42 +01:00
Disallow colour names in offline-mode. This fixes BUKKIT-439. Thanks to cainfool for the discovery.
This commit is contained in:
parent
76d7a1ce1d
commit
51a056ecd5
@ -6,6 +6,7 @@ import java.util.Random;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||||
import org.bukkit.event.server.ServerListPingEvent;
|
import org.bukkit.event.server.ServerListPingEvent;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@ -77,6 +78,12 @@ public class NetLoginHandler extends NetHandler {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!this.server.onlineMode) {
|
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);
|
this.b(packet1login);
|
||||||
} else {
|
} else {
|
||||||
(new ThreadLoginVerifier(this, packet1login, this.server.server)).start(); // CraftBukkit
|
(new ThreadLoginVerifier(this, packet1login, this.server.server)).start(); // CraftBukkit
|
||||||
|
Loading…
Reference in New Issue
Block a user