From 1e754d716a13c84f061c4d6358099b7ec83f0749 Mon Sep 17 00:00:00 2001 From: Petr Ilin Date: Tue, 12 Apr 2022 21:21:13 +0300 Subject: "null hash" issue fix for other columns --- .../net/elytrium/limboauth/handler/AuthSessionHandler.java | 1 + .../java/net/elytrium/limboauth/listener/AuthListener.java | 2 +- .../java/net/elytrium/limboauth/model/RegisteredPlayer.java | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/java/net/elytrium') diff --git a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java index 1501aae..4e330ce 100644 --- a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java +++ b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java @@ -249,6 +249,7 @@ public class AuthSessionHandler implements LimboSessionHandler { long checkDate = System.currentTimeMillis() - Settings.IMP.MAIN.IP_LIMIT_VALID_TIME; alreadyRegistered.stream() + .filter(e -> e.getRegDate() != null) .filter(e -> e.getRegDate() < checkDate) .forEach(e -> { try { diff --git a/src/main/java/net/elytrium/limboauth/listener/AuthListener.java b/src/main/java/net/elytrium/limboauth/listener/AuthListener.java index 991630d..e029258 100644 --- a/src/main/java/net/elytrium/limboauth/listener/AuthListener.java +++ b/src/main/java/net/elytrium/limboauth/listener/AuthListener.java @@ -85,7 +85,7 @@ public class AuthListener { if (Settings.IMP.MAIN.SAVE_UUID && (this.floodgateApi == null || !this.floodgateApi.isFloodgatePlayer(event.getOriginalProfile().getId()))) { RegisteredPlayer registeredPlayer = AuthSessionHandler.fetchInfo(this.playerDao, event.getOriginalProfile().getId()); - if (registeredPlayer != null) { + if (registeredPlayer != null && !registeredPlayer.getUuid().isEmpty()) { event.setGameProfile(event.getOriginalProfile().withId(UUID.fromString(registeredPlayer.getUuid()))); return; } diff --git a/src/main/java/net/elytrium/limboauth/model/RegisteredPlayer.java b/src/main/java/net/elytrium/limboauth/model/RegisteredPlayer.java index 71519d8..7567f61 100644 --- a/src/main/java/net/elytrium/limboauth/model/RegisteredPlayer.java +++ b/src/main/java/net/elytrium/limboauth/model/RegisteredPlayer.java @@ -69,7 +69,7 @@ public class RegisteredPlayer { } public String getNickname() { - return this.nickname; + return this.nickname == null ? this.lowercaseNickname : this.nickname; } public void setLowercaseNickname(String lowercaseNickname) { @@ -93,7 +93,7 @@ public class RegisteredPlayer { } public String getIP() { - return this.ip; + return this.ip == null ? "" : this.ip; } public void setTotpToken(String totpToken) { @@ -101,7 +101,7 @@ public class RegisteredPlayer { } public String getTotpToken() { - return this.totpToken; + return this.totpToken == null ? "" : this.totpToken; } public void setRegDate(Long regDate) { @@ -117,7 +117,7 @@ public class RegisteredPlayer { } public String getUuid() { - return this.uuid; + return this.uuid == null ? "" : this.uuid; } public void setPremiumUuid(String premiumUuid) { @@ -125,6 +125,6 @@ public class RegisteredPlayer { } public String getPremiumUuid() { - return this.premiumUuid; + return this.premiumUuid == null ? "" : this.premiumUuid; } } -- cgit