3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00

Don't special case 'invalid' usernames for UUIDs.

Dieser Commit ist enthalten in:
md_5 2014-04-20 18:58:00 +10:00
Ursprung c15d869440
Commit 6e0b0a1b55

Datei anzeigen

@ -170,8 +170,6 @@ public final class CraftServer implements Server {
private CraftIconCache icon; private CraftIconCache icon;
private boolean overrideAllCommandBlockCommands = false; private boolean overrideAllCommandBlockCommands = false;
private boolean unrestrictedAdvancements; private boolean unrestrictedAdvancements;
private final Pattern validUserPattern = Pattern.compile("^[a-zA-Z0-9_]{2,16}$");
private final UUID invalidUserUUID = UUID.nameUUIDFromBytes("InvalidUsername".getBytes(Charsets.UTF_8));
private final List<CraftPlayer> playerView; private final List<CraftPlayer> playerView;
public int reloadCount; public int reloadCount;
@ -1246,11 +1244,6 @@ public final class CraftServer implements Server {
public OfflinePlayer getOfflinePlayer(String name) { public OfflinePlayer getOfflinePlayer(String name) {
Validate.notNull(name, "Name cannot be null"); Validate.notNull(name, "Name cannot be null");
// If the name given cannot ever be a valid username give a dummy return, for scoreboard plugins
if (!validUserPattern.matcher(name).matches()) {
return new CraftOfflinePlayer(this, new GameProfile(invalidUserUUID, name));
}
OfflinePlayer result = getPlayerExact(name); OfflinePlayer result = getPlayerExact(name);
if (result == null) { if (result == null) {
// This is potentially blocking :( // This is potentially blocking :(