diff options
author | kforbro <kforbro@gmail.com> | 2022-07-19 01:39:09 +0300 |
---|---|---|
committer | mdxd44 <ogurec332@mail.ru> | 2022-07-23 00:45:49 +0900 |
commit | fa0c8b27b0d3bcafd3b7893b7730aa69849965aa (patch) | |
tree | 27fbd144acf85e1579616d6b1ccb0a62716e3357 /src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java | |
parent | b0b208b02f629eaaeabc6a380349a64adb642d45 (diff) | |
download | LimboAuth-fa0c8b27b0d3bcafd3b7893b7730aa69849965aa.tar.gz LimboAuth-fa0c8b27b0d3bcafd3b7893b7730aa69849965aa.tar.bz2 LimboAuth-fa0c8b27b0d3bcafd3b7893b7730aa69849965aa.zip |
Hint in WRONG_NICKNAME_CASE_KICK. (#44)
Diffstat (limited to 'src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java')
-rw-r--r-- | src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java index de50281..6f4b27e 100644 --- a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java +++ b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java @@ -60,7 +60,7 @@ public class AuthSessionHandler implements LimboSessionHandler { private static BossBar.Overlay bossbarOverlay; private static Component ipLimitKick; private static Component databaseErrorKick; - private static Component wrongNicknameCaseKick; + private static String wrongNicknameCaseKick; private static Component timesUp; private static Component registerSuccessful; @Nullable @@ -122,6 +122,8 @@ public class AuthSessionHandler implements LimboSessionHandler { this.player.disableFalling(); + Serializer serializer = LimboAuth.getSerializer(); + if (this.playerInfo == null) { try { List<RegisteredPlayer> alreadyRegistered = this.playerDao.queryForEq("IP", this.ip); @@ -149,13 +151,14 @@ public class AuthSessionHandler implements LimboSessionHandler { } } else { if (!this.proxyPlayer.getUsername().equals(this.playerInfo.getNickname())) { - this.proxyPlayer.disconnect(wrongNicknameCaseKick); + this.proxyPlayer.disconnect(serializer.deserialize( + MessageFormat.format(wrongNicknameCaseKick, this.playerInfo.getNickname(), this.proxyPlayer.getUsername())) + ); return; } } boolean bossBarEnabled = Settings.IMP.MAIN.ENABLE_BOSSBAR; - Serializer serializer = LimboAuth.getSerializer(); int authTime = Settings.IMP.MAIN.AUTH_TIME; float multiplier = 1000.0F / authTime; this.authMainTask = this.player.getScheduledExecutor().scheduleWithFixedDelay(() -> { @@ -346,7 +349,7 @@ public class AuthSessionHandler implements LimboSessionHandler { bossbarOverlay = BossBar.Overlay.valueOf(Settings.IMP.MAIN.BOSSBAR_OVERLAY.toUpperCase(Locale.ROOT)); ipLimitKick = serializer.deserialize(Settings.IMP.MAIN.STRINGS.IP_LIMIT_KICK); databaseErrorKick = serializer.deserialize(Settings.IMP.MAIN.STRINGS.DATABASE_ERROR_KICK); - wrongNicknameCaseKick = serializer.deserialize(Settings.IMP.MAIN.STRINGS.WRONG_NICKNAME_CASE_KICK); + wrongNicknameCaseKick = Settings.IMP.MAIN.STRINGS.WRONG_NICKNAME_CASE_KICK; timesUp = serializer.deserialize(Settings.IMP.MAIN.STRINGS.TIMES_UP); registerSuccessful = serializer.deserialize(Settings.IMP.MAIN.STRINGS.REGISTER_SUCCESSFUL); if (Settings.IMP.MAIN.STRINGS.REGISTER_SUCCESSFUL_TITLE.isEmpty() && Settings.IMP.MAIN.STRINGS.REGISTER_SUCCESSFUL_SUBTITLE.isEmpty()) { |