diff options
Diffstat (limited to 'src')
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; } } |