From b21c02eca0985838f121dd1601097939e255a1ab Mon Sep 17 00:00:00 2001 From: Tux Date: Mon, 22 Jun 2015 03:47:21 -0400 Subject: [PATCH] If an expired UUID/name entry is found, also expunge the other entry. --- .../minecraft/redisbungee/util/UUIDTranslator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java index addc75c..6459747 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java @@ -105,6 +105,8 @@ public final class UUIDTranslator { // Check for expiry: if (entry.expired()) { jedis.hdel("uuid-cache", player.toLowerCase()); + // Doesn't hurt to also remove the UUID entry as well. + jedis.hdel("uuid-cache", entry.getUuid().toString()); } else { nameToUuidMap.put(player.toLowerCase(), entry); uuidToNameMap.put(entry.getUuid(), entry); @@ -161,6 +163,9 @@ public final class UUIDTranslator { // Check for expiry: if (entry.expired()) { jedis.hdel("uuid-cache", player.toString()); + // Doesn't hurt to also remove the named entry as well. + // TODO: Since UUIDs are fixed, we could look up the name and see if the UUID matches. + jedis.hdel("uuid-cache", entry.getName()); } else { nameToUuidMap.put(entry.getName().toLowerCase(), entry); uuidToNameMap.put(player, entry);