diff options
author | Petr Ilin <hevav@hevav.dev> | 2022-04-03 23:00:29 +0300 |
---|---|---|
committer | Petr Ilin <hevav@hevav.dev> | 2022-04-03 23:00:29 +0300 |
commit | 756c1107de7babeb37583b74b55e431f13dc0f45 (patch) | |
tree | 0f32464bb392f6bcff6084009638df9bc0ed0ba6 | |
parent | b86b1ec801bca9eaf75be8eafe043062cbf9c7a0 (diff) | |
download | LimboAuth-756c1107de7babeb37583b74b55e431f13dc0f45.tar.gz LimboAuth-756c1107de7babeb37583b74b55e431f13dc0f45.tar.bz2 LimboAuth-756c1107de7babeb37583b74b55e431f13dc0f45.zip |
Session fix x2
-rw-r--r-- | src/main/java/net/elytrium/limboauth/LimboAuth.java | 7 |
1 files changed, 4 insertions, 3 deletions
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); } } |