diff options
author | Petr Ilin <hevav@hevav.dev> | 2022-04-12 21:21:13 +0300 |
---|---|---|
committer | Petr Ilin <hevav@hevav.dev> | 2022-04-12 21:21:13 +0300 |
commit | 1e754d716a13c84f061c4d6358099b7ec83f0749 (patch) | |
tree | c438e3adbbdf8d8a353b06c2b40eb3968958123c | |
parent | 7442eebe03996ae20cc6e7d16ecd0ae6abe52519 (diff) | |
download | LimboAuth-1e754d716a13c84f061c4d6358099b7ec83f0749.tar.gz LimboAuth-1e754d716a13c84f061c4d6358099b7ec83f0749.tar.bz2 LimboAuth-1e754d716a13c84f061c4d6358099b7ec83f0749.zip |
"null hash" issue fix for other columns
3 files changed, 7 insertions, 6 deletions
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; } } |