From 756c1107de7babeb37583b74b55e431f13dc0f45 Mon Sep 17 00:00:00 2001 From: Petr Ilin Date: Sun, 3 Apr 2022 23:00:29 +0300 Subject: Session fix x2 --- src/main/java/net/elytrium/limboauth/LimboAuth.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/net') diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java index bdde110..329fcb7 100644 --- a/src/main/java/net/elytrium/limboauth/LimboAuth.java +++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java @@ -372,11 +372,12 @@ public class LimboAuth { } public boolean needAuth(Player player) { - String username = player.getUsername().toLowerCase(Locale.ROOT); - if (!this.cachedAuthChecks.containsKey(username)) { + String username = player.getUsername(); + String lowercaseUsername = username.toLowerCase(Locale.ROOT); + if (!this.cachedAuthChecks.containsKey(lowercaseUsername)) { return true; } else { - CachedSessionUser sessionUser = this.cachedAuthChecks.get(username); + CachedSessionUser sessionUser = this.cachedAuthChecks.get(lowercaseUsername); return !sessionUser.getInetAddress().equals(player.getRemoteAddress().getAddress()) || !sessionUser.getUsername().equals(username); } } -- cgit