Check player name for invalid character first

This commit is contained in:
Jesse Boyd 2017-01-30 19:42:16 +11:00
parent 88f5e5b0bc
commit e7990a06e2
No known key found for this signature in database
GPG key ID: 59F1DE6293AF6E1F
2 changed files with 10 additions and 1 deletions

View file

@ -279,4 +279,13 @@ public class StringMan {
}
return col;
}
public static boolean contains(String name, char c) {
for (char current : name.toCharArray()) {
if (c == current) {
return true;
}
}
return false;
}
}

View file

@ -232,7 +232,7 @@ public abstract class UUIDHandlerImplementation {
return uuid;
}
// Read from disk OR convert directly to offline UUID
if (Settings.UUID.OFFLINE) {
if (Settings.UUID.OFFLINE && !StringMan.contains(name, ';')) {
uuid = this.uuidWrapper.getUUID(name);
add(new StringWrapper(name), uuid);
return uuid;