diff options
author | Petr Ilin <hevav@hevav.dev> | 2022-03-30 21:17:37 +0300 |
---|---|---|
committer | Petr Ilin <hevav@hevav.dev> | 2022-03-30 21:17:37 +0300 |
commit | 72ed13caabe733cb9ce7a97acc1255e13b5a6d3c (patch) | |
tree | 4bd0978452dc0e428bc76e8c31a739091949265a | |
parent | 2fa4a044911eb6ef61832d41b0c3dd07a16598b4 (diff) | |
download | LimboAuth-72ed13caabe733cb9ce7a97acc1255e13b5a6d3c.tar.gz LimboAuth-72ed13caabe733cb9ce7a97acc1255e13b5a6d3c.tar.bz2 LimboAuth-72ed13caabe733cb9ce7a97acc1255e13b5a6d3c.zip |
Lowercased player caching
-rw-r--r-- | src/main/java/net/elytrium/limboauth/LimboAuth.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java index f499df6..530076a 100644 --- a/src/main/java/net/elytrium/limboauth/LimboAuth.java +++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java @@ -353,17 +353,17 @@ public class LimboAuth { } public void cacheAuthUser(Player player) { - String username = player.getUsername(); + String username = player.getUsername().toLowerCase(Locale.ROOT); this.cachedAuthChecks.remove(username); this.cachedAuthChecks.put(username, new CachedUser(player.getRemoteAddress().getAddress(), System.currentTimeMillis())); } public void removePlayerFromCache(String username) { - this.cachedAuthChecks.remove(username); + this.cachedAuthChecks.remove(username.toLowerCase(Locale.ROOT)); } public boolean needAuth(Player player) { - String username = player.getUsername(); + String username = player.getUsername().toLowerCase(Locale.ROOT); if (!this.cachedAuthChecks.containsKey(username)) { return true; } else { |