Check skin name length is 3-16 characters when fetching players

This commit is contained in:
fullwall 2020-12-21 17:32:30 +08:00
parent 4c33fa4f86
commit 09c482e2f6
3 changed files with 6 additions and 6 deletions

View File

@ -33,7 +33,8 @@ public class ProfileRequest {
* @param handler
* Optional handler to handle the result for the profile. Handler always invoked from the main thread.
*/
ProfileRequest(String playerName, @Nullable ProfileFetchHandler handler) {
public ProfileRequest(String playerName, ProfileFetchHandler handler) {
Preconditions.checkNotNull(playerName);
this.playerName = playerName;

View File

@ -155,9 +155,9 @@ public class Skin {
}
return;
}
if (this.skinName.length() < 3) {
if (skinName.length() < 3 || skinName.length() > 16) {
if (Messaging.isDebugging()) {
Messaging.debug("Skin name too short '" + skinName + "'");
Messaging.debug("Skin name invalid length '" + skinName + "'");
}
return;
}
@ -208,9 +208,9 @@ public class Skin {
}
return;
}
if (this.skinName.length() < 3) {
if (skinName.length() < 3 || skinName.length() > 16) {
if (Messaging.isDebugging()) {
Messaging.debug("Skin name too short '" + skinName + "'");
Messaging.debug("Skin name invalid length '" + skinName + "'");
}
return;
}

View File

@ -30,7 +30,6 @@ import net.citizensnpcs.util.NMS;
public class SkinPacketTracker {
private final SkinnableEntity entity;
private final Map<UUID, PlayerEntry> inProgress = new HashMap<UUID, PlayerEntry>(Bukkit.getMaxPlayers() / 2);
private boolean isRemoved;
private Skin skin;