Don't lookup game profiles that have no UUID and no name

This commit is contained in:
Zach Brown
2016-07-16 19:11:17 -05:00
parent d072c2d5fb
commit a55727ff06

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/players/GameProfileCache.java --- a/net/minecraft/server/players/GameProfileCache.java
+++ b/net/minecraft/server/players/GameProfileCache.java +++ b/net/minecraft/server/players/GameProfileCache.java
@@ -85,7 +85,7 @@ @@ -85,10 +85,11 @@
} }
public void onProfileLookupFailed(String s1, Exception exception) { public void onProfileLookupFailed(String s1, Exception exception) {
@@ -9,7 +9,11 @@
} }
}; };
@@ -117,7 +117,7 @@ + if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();
@@ -117,7 +118,7 @@
GameProfileCache.GameProfileInfo usercache_usercacheentry = new GameProfileCache.GameProfileInfo(profile, date); GameProfileCache.GameProfileInfo usercache_usercacheentry = new GameProfileCache.GameProfileInfo(profile, date);
this.safeAdd(usercache_usercacheentry); this.safeAdd(usercache_usercacheentry);
@@ -18,7 +22,7 @@
} }
private long getNextOperation() { private long getNextOperation() {
@@ -142,15 +142,15 @@ @@ -142,15 +143,15 @@
usercache_usercacheentry.setLastAccess(this.getNextOperation()); usercache_usercacheentry.setLastAccess(this.getNextOperation());
optional = Optional.of(usercache_usercacheentry.getProfile()); optional = Optional.of(usercache_usercacheentry.getProfile());
} else { } else {
@@ -37,7 +41,7 @@
} }
return optional; return optional;
@@ -208,7 +208,7 @@ @@ -208,7 +209,7 @@
label54: label54:
{ {
@@ -46,7 +50,7 @@
try { try {
JsonArray jsonarray = (JsonArray) this.gson.fromJson(bufferedreader, JsonArray.class); JsonArray jsonarray = (JsonArray) this.gson.fromJson(bufferedreader, JsonArray.class);
@@ -217,7 +217,7 @@ @@ -217,7 +218,7 @@
DateFormat dateformat = GameProfileCache.createDateFormat(); DateFormat dateformat = GameProfileCache.createDateFormat();
jsonarray.forEach((jsonelement) -> { jsonarray.forEach((jsonelement) -> {
@@ -55,7 +59,7 @@
Objects.requireNonNull(list); Objects.requireNonNull(list);
optional.ifPresent(list::add); optional.ifPresent(list::add);
@@ -250,6 +250,11 @@ @@ -250,6 +251,11 @@
} }
} catch (FileNotFoundException filenotfoundexception) { } catch (FileNotFoundException filenotfoundexception) {
; ;
@@ -67,7 +71,7 @@
} catch (JsonParseException | IOException ioexception) { } catch (JsonParseException | IOException ioexception) {
GameProfileCache.LOGGER.warn("Failed to load profile cache {}", this.file, ioexception); GameProfileCache.LOGGER.warn("Failed to load profile cache {}", this.file, ioexception);
} }
@@ -257,14 +262,15 @@ @@ -257,14 +263,15 @@
return list; return list;
} }
@@ -85,7 +89,7 @@
try { try {
BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8); BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8);
@@ -289,6 +295,14 @@ @@ -289,6 +296,14 @@
} catch (IOException ioexception) { } catch (IOException ioexception) {
; ;
} }