From 23f6763f330290b8d58d42133b9c4890ef1f4173 Mon Sep 17 00:00:00 2001 From: Petr Ilin Date: Sun, 12 Jun 2022 01:23:21 +0300 Subject: 1.19 chat moment --- .../java/net/elytrium/limboauth/LimboAuth.java | 5 +-- .../limboauth/command/ChangePasswordCommand.java | 15 +++++---- .../limboauth/command/DestroySessionCommand.java | 5 +-- .../command/ForceChangePasswordCommand.java | 10 +++--- .../limboauth/command/ForceUnregisterCommand.java | 7 ++-- .../limboauth/command/LimboAuthCommand.java | 15 +++++---- .../elytrium/limboauth/command/PremiumCommand.java | 15 +++++---- .../elytrium/limboauth/command/TotpCommand.java | 39 ++++++++++++---------- .../limboauth/command/UnregisterCommand.java | 13 ++++---- .../limboauth/handler/AuthSessionHandler.java | 21 ++++++------ 10 files changed, 80 insertions(+), 65 deletions(-) (limited to 'src/main/java/net') diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java index cc7c291..0287dea 100644 --- a/src/main/java/net/elytrium/limboauth/LimboAuth.java +++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java @@ -95,6 +95,7 @@ import net.elytrium.limboauth.floodgate.FloodgateApiHolder; import net.elytrium.limboauth.handler.AuthSessionHandler; import net.elytrium.limboauth.listener.AuthListener; import net.elytrium.limboauth.model.RegisteredPlayer; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.ComponentSerializer; import net.kyori.adventure.title.Title; @@ -483,14 +484,14 @@ public class LimboAuth { this.postLoginTasks.put(player.getUniqueId(), () -> { if (onlineMode) { if (this.loginPremium != null) { - player.sendMessage(this.loginPremium); + player.sendMessage(this.loginPremium, MessageType.SYSTEM); } if (this.loginPremiumTitle != null) { player.showTitle(this.loginPremiumTitle); } } else { if (this.loginFloodgate != null) { - player.sendMessage(this.loginFloodgate); + player.sendMessage(this.loginFloodgate, MessageType.SYSTEM); } if (this.loginFloodgateTitle != null) { player.showTitle(this.loginFloodgateTitle); diff --git a/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java b/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java index f280053..53280ec 100644 --- a/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java @@ -29,6 +29,7 @@ import net.elytrium.limboauth.LimboAuth; import net.elytrium.limboauth.Settings; import net.elytrium.limboauth.handler.AuthSessionHandler; import net.elytrium.limboauth.model.RegisteredPlayer; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; public class ChangePasswordCommand implements SimpleCommand { @@ -68,12 +69,12 @@ public class ChangePasswordCommand implements SimpleCommand { if (this.needOldPass) { RegisteredPlayer player = AuthSessionHandler.fetchInfo(this.playerDao, ((Player) source).getUsername()); if (player == null) { - source.sendMessage(this.notRegistered); + source.sendMessage(this.notRegistered, MessageType.SYSTEM); return; } else if (player.getHash().isEmpty()) { - source.sendMessage(this.crackedCommand); + source.sendMessage(this.crackedCommand, MessageType.SYSTEM); } else if (!AuthSessionHandler.checkPassword(args[0], player, this.playerDao)) { - source.sendMessage(this.wrongPassword); + source.sendMessage(this.wrongPassword, MessageType.SYSTEM); return; } } @@ -84,16 +85,16 @@ public class ChangePasswordCommand implements SimpleCommand { updateBuilder.updateColumnValue("HASH", AuthSessionHandler.genHash(this.needOldPass ? args[1] : args[0])); updateBuilder.update(); - source.sendMessage(this.successful); + source.sendMessage(this.successful, MessageType.SYSTEM); } catch (SQLException e) { - source.sendMessage(this.errorOccurred); + source.sendMessage(this.errorOccurred, MessageType.SYSTEM); e.printStackTrace(); } } else { - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } } else { - source.sendMessage(this.notPlayer); + source.sendMessage(this.notPlayer, MessageType.SYSTEM); } } diff --git a/src/main/java/net/elytrium/limboauth/command/DestroySessionCommand.java b/src/main/java/net/elytrium/limboauth/command/DestroySessionCommand.java index 95e002c..53f460f 100644 --- a/src/main/java/net/elytrium/limboauth/command/DestroySessionCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/DestroySessionCommand.java @@ -24,6 +24,7 @@ import com.velocitypowered.api.proxy.Player; import net.elytrium.java.commons.mc.serialization.Serializer; import net.elytrium.limboauth.LimboAuth; import net.elytrium.limboauth.Settings; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; public class DestroySessionCommand implements SimpleCommand { @@ -47,9 +48,9 @@ public class DestroySessionCommand implements SimpleCommand { if (source instanceof Player) { this.plugin.removePlayerFromCache(((Player) source).getUsername()); - source.sendMessage(this.successful); + source.sendMessage(this.successful, MessageType.SYSTEM); } else { - source.sendMessage(this.notPlayer); + source.sendMessage(this.notPlayer, MessageType.SYSTEM); } } diff --git a/src/main/java/net/elytrium/limboauth/command/ForceChangePasswordCommand.java b/src/main/java/net/elytrium/limboauth/command/ForceChangePasswordCommand.java index 2d47b61..6704650 100644 --- a/src/main/java/net/elytrium/limboauth/command/ForceChangePasswordCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/ForceChangePasswordCommand.java @@ -32,6 +32,7 @@ import net.elytrium.limboauth.LimboAuth; import net.elytrium.limboauth.Settings; import net.elytrium.limboauth.handler.AuthSessionHandler; import net.elytrium.limboauth.model.RegisteredPlayer; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; public class ForceChangePasswordCommand implements SimpleCommand { @@ -75,15 +76,16 @@ public class ForceChangePasswordCommand implements SimpleCommand { updateBuilder.updateColumnValue("HASH", AuthSessionHandler.genHash(newPassword)); updateBuilder.update(); - this.server.getPlayer(nickname).ifPresent(player -> player.sendMessage(serializer.deserialize(MessageFormat.format(this.message, newPassword)))); + this.server.getPlayer(nickname) + .ifPresent(player -> player.sendMessage(serializer.deserialize(MessageFormat.format(this.message, newPassword)), MessageType.SYSTEM)); - source.sendMessage(serializer.deserialize(MessageFormat.format(this.successful, nickname))); + source.sendMessage(serializer.deserialize(MessageFormat.format(this.successful, nickname)), MessageType.SYSTEM); } catch (SQLException e) { - source.sendMessage(serializer.deserialize(MessageFormat.format(this.notSuccessful, nickname))); + source.sendMessage(serializer.deserialize(MessageFormat.format(this.notSuccessful, nickname)), MessageType.SYSTEM); e.printStackTrace(); } } else { - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } } diff --git a/src/main/java/net/elytrium/limboauth/command/ForceUnregisterCommand.java b/src/main/java/net/elytrium/limboauth/command/ForceUnregisterCommand.java index 2fd12ca..f065d25 100644 --- a/src/main/java/net/elytrium/limboauth/command/ForceUnregisterCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/ForceUnregisterCommand.java @@ -30,6 +30,7 @@ import net.elytrium.java.commons.mc.velocity.commands.SuggestUtils; import net.elytrium.limboauth.LimboAuth; import net.elytrium.limboauth.Settings; import net.elytrium.limboauth.model.RegisteredPlayer; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; public class ForceUnregisterCommand implements SimpleCommand { @@ -73,13 +74,13 @@ public class ForceUnregisterCommand implements SimpleCommand { this.playerDao.deleteById(playerNick.toLowerCase(Locale.ROOT)); this.plugin.removePlayerFromCache(playerNick); this.server.getPlayer(playerNick).ifPresent(player -> player.disconnect(this.kick)); - source.sendMessage(serializer.deserialize(MessageFormat.format(this.successful, playerNick))); + source.sendMessage(serializer.deserialize(MessageFormat.format(this.successful, playerNick)), MessageType.SYSTEM); } catch (SQLException e) { - source.sendMessage(serializer.deserialize(MessageFormat.format(this.notSuccessful, playerNick))); + source.sendMessage(serializer.deserialize(MessageFormat.format(this.notSuccessful, playerNick)), MessageType.SYSTEM); e.printStackTrace(); } } else { - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } } diff --git a/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java b/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java index 3dd4c8d..ff31023 100644 --- a/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/LimboAuthCommand.java @@ -26,6 +26,7 @@ import java.util.stream.Collectors; import net.elytrium.java.commons.mc.serialization.Serializer; import net.elytrium.limboauth.LimboAuth; import net.elytrium.limboauth.Settings; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; @@ -102,10 +103,10 @@ public class LimboAuthCommand implements SimpleCommand { if (command.equalsIgnoreCase("reload") && source.hasPermission("limboauth.admin.reload")) { try { this.plugin.reload(); - source.sendMessage(serializer.deserialize(Settings.IMP.MAIN.STRINGS.RELOAD)); + source.sendMessage(serializer.deserialize(Settings.IMP.MAIN.STRINGS.RELOAD), MessageType.SYSTEM); } catch (Exception e) { e.printStackTrace(); - source.sendMessage(serializer.deserialize(Settings.IMP.MAIN.STRINGS.RELOAD_FAILED)); + source.sendMessage(serializer.deserialize(Settings.IMP.MAIN.STRINGS.RELOAD_FAILED), MessageType.SYSTEM); } return; @@ -142,15 +143,17 @@ public class LimboAuthCommand implements SimpleCommand { } private void showHelp(CommandSource source) { - HELP_MESSAGE.forEach(source::sendMessage); + for (Component component : HELP_MESSAGE) { + source.sendMessage(component, MessageType.SYSTEM); + } List> availableSubcommands = SUBCOMMANDS.entrySet().stream() .filter(command -> source.hasPermission("limboauth.admin." + command.getKey())) .collect(Collectors.toList()); if (availableSubcommands.size() > 0) { - source.sendMessage(AVAILABLE_SUBCOMMANDS_MESSAGE); - availableSubcommands.forEach(command -> source.sendMessage(command.getValue())); + source.sendMessage(AVAILABLE_SUBCOMMANDS_MESSAGE, MessageType.SYSTEM); + availableSubcommands.forEach(command -> source.sendMessage(command.getValue(), MessageType.SYSTEM)); } else { - source.sendMessage(NO_AVAILABLE_SUBCOMMANDS_MESSAGE); + source.sendMessage(NO_AVAILABLE_SUBCOMMANDS_MESSAGE, MessageType.SYSTEM); } } } diff --git a/src/main/java/net/elytrium/limboauth/command/PremiumCommand.java b/src/main/java/net/elytrium/limboauth/command/PremiumCommand.java index 78674d0..cc73652 100644 --- a/src/main/java/net/elytrium/limboauth/command/PremiumCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/PremiumCommand.java @@ -28,6 +28,7 @@ import net.elytrium.limboauth.LimboAuth; import net.elytrium.limboauth.Settings; import net.elytrium.limboauth.handler.AuthSessionHandler; import net.elytrium.limboauth.model.RegisteredPlayer; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; public class PremiumCommand implements SimpleCommand { @@ -72,9 +73,9 @@ public class PremiumCommand implements SimpleCommand { String username = ((Player) source).getUsername(); RegisteredPlayer player = AuthSessionHandler.fetchInfo(this.playerDao, username); if (player == null) { - source.sendMessage(this.notRegistered); + source.sendMessage(this.notRegistered, MessageType.SYSTEM); } else if (player.getHash().isEmpty()) { - source.sendMessage(this.alreadyPremium); + source.sendMessage(this.alreadyPremium, MessageType.SYSTEM); } else if (AuthSessionHandler.checkPassword(args[0], player, this.playerDao)) { if (this.plugin.isPremiumExternal(username)) { try { @@ -83,23 +84,23 @@ public class PremiumCommand implements SimpleCommand { this.plugin.removePlayerFromCache(username); ((Player) source).disconnect(this.successful); } catch (SQLException e) { - source.sendMessage(this.errorOccurred); + source.sendMessage(this.errorOccurred, MessageType.SYSTEM); e.printStackTrace(); } } else { - source.sendMessage(this.notPremium); + source.sendMessage(this.notPremium, MessageType.SYSTEM); } } else { - source.sendMessage(this.wrongPassword); + source.sendMessage(this.wrongPassword, MessageType.SYSTEM); } return; } } - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } else { - source.sendMessage(this.notPlayer); + source.sendMessage(this.notPlayer, MessageType.SYSTEM); } } diff --git a/src/main/java/net/elytrium/limboauth/command/TotpCommand.java b/src/main/java/net/elytrium/limboauth/command/TotpCommand.java index 54d9c3e..7609020 100644 --- a/src/main/java/net/elytrium/limboauth/command/TotpCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/TotpCommand.java @@ -36,6 +36,7 @@ import net.elytrium.limboauth.LimboAuth; import net.elytrium.limboauth.Settings; import net.elytrium.limboauth.handler.AuthSessionHandler; import net.elytrium.limboauth.model.RegisteredPlayer; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.ClickEvent; @@ -94,7 +95,7 @@ public class TotpCommand implements SimpleCommand { if (source instanceof Player) { if (args.length == 0) { - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } else { String username = ((Player) source).getUsername(); @@ -104,18 +105,18 @@ public class TotpCommand implements SimpleCommand { if (this.needPassword ? args.length == 2 : args.length == 1) { playerInfo = AuthSessionHandler.fetchInfo(this.playerDao, username); if (playerInfo == null) { - source.sendMessage(this.notRegistered); + source.sendMessage(this.notRegistered, MessageType.SYSTEM); return; } else if (playerInfo.getHash().isEmpty()) { - source.sendMessage(this.crackedCommand); + source.sendMessage(this.crackedCommand, MessageType.SYSTEM); return; } else if (this.needPassword && !AuthSessionHandler.checkPassword(args[1], playerInfo, this.playerDao)) { - source.sendMessage(this.wrongPassword); + source.sendMessage(this.wrongPassword, MessageType.SYSTEM); return; } if (!playerInfo.getTotpToken().isEmpty()) { - source.sendMessage(this.alreadyEnabled); + source.sendMessage(this.alreadyEnabled, MessageType.SYSTEM); return; } @@ -126,10 +127,10 @@ public class TotpCommand implements SimpleCommand { updateBuilder.updateColumnValue("TOTPTOKEN", secret); updateBuilder.update(); } catch (SQLException e) { - source.sendMessage(this.errorOccurred); + source.sendMessage(this.errorOccurred, MessageType.SYSTEM); e.printStackTrace(); } - source.sendMessage(this.successful); + source.sendMessage(this.successful, MessageType.SYSTEM); QrData data = new QrData.Builder() .label(username) @@ -137,21 +138,23 @@ public class TotpCommand implements SimpleCommand { .issuer(this.issuer) .build(); String qrUrl = this.qrGeneratorUrl.replace("{data}", URLEncoder.encode(data.getUri(), StandardCharsets.UTF_8)); - source.sendMessage(this.qr.clickEvent(ClickEvent.openUrl(qrUrl))); + source.sendMessage(this.qr.clickEvent(ClickEvent.openUrl(qrUrl)), MessageType.SYSTEM); Serializer serializer = LimboAuth.getSerializer(); - source.sendMessage(serializer.deserialize(MessageFormat.format(this.token, secret)).clickEvent(ClickEvent.copyToClipboard(secret))); + source.sendMessage(serializer.deserialize(MessageFormat.format(this.token, secret)) + .clickEvent(ClickEvent.copyToClipboard(secret)), MessageType.SYSTEM); String codes = String.join(", ", this.codesGenerator.generateCodes(this.recoveryCodesAmount)); - source.sendMessage(serializer.deserialize(MessageFormat.format(this.recovery, codes)).clickEvent(ClickEvent.copyToClipboard(codes))); + source.sendMessage(serializer.deserialize(MessageFormat.format(this.recovery, codes)) + .clickEvent(ClickEvent.copyToClipboard(codes)), MessageType.SYSTEM); } else { - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } } else if (args[0].equalsIgnoreCase("disable")) { if (args.length == 2) { playerInfo = AuthSessionHandler.fetchInfo(this.playerDao, username); if (playerInfo == null) { - source.sendMessage(this.notRegistered); + source.sendMessage(this.notRegistered, MessageType.SYSTEM); return; } @@ -162,23 +165,23 @@ public class TotpCommand implements SimpleCommand { updateBuilder.updateColumnValue("TOTPTOKEN", ""); updateBuilder.update(); - source.sendMessage(this.disabled); + source.sendMessage(this.disabled, MessageType.SYSTEM); } catch (SQLException e) { - source.sendMessage(this.errorOccurred); + source.sendMessage(this.errorOccurred, MessageType.SYSTEM); e.printStackTrace(); } } else { - source.sendMessage(this.wrong); + source.sendMessage(this.wrong, MessageType.SYSTEM); } } else { - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } } else { - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } } } else { - source.sendMessage(this.notPlayer); + source.sendMessage(this.notPlayer, MessageType.SYSTEM); } } diff --git a/src/main/java/net/elytrium/limboauth/command/UnregisterCommand.java b/src/main/java/net/elytrium/limboauth/command/UnregisterCommand.java index b6c11ff..b5ab2a0 100644 --- a/src/main/java/net/elytrium/limboauth/command/UnregisterCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/UnregisterCommand.java @@ -30,6 +30,7 @@ import net.elytrium.limboauth.Settings; import net.elytrium.limboauth.event.AuthUnregisterEvent; import net.elytrium.limboauth.handler.AuthSessionHandler; import net.elytrium.limboauth.model.RegisteredPlayer; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.text.Component; public class UnregisterCommand implements SimpleCommand { @@ -72,9 +73,9 @@ public class UnregisterCommand implements SimpleCommand { String username = ((Player) source).getUsername(); RegisteredPlayer player = AuthSessionHandler.fetchInfo(this.playerDao, username); if (player == null) { - source.sendMessage(this.notRegistered); + source.sendMessage(this.notRegistered, MessageType.SYSTEM); } else if (player.getHash().isEmpty()) { - source.sendMessage(this.crackedCommand); + source.sendMessage(this.crackedCommand, MessageType.SYSTEM); } else if (AuthSessionHandler.checkPassword(args[0], player, this.playerDao)) { try { this.plugin.getServer().getEventManager().fireAndForget(new AuthUnregisterEvent(username)); @@ -82,20 +83,20 @@ public class UnregisterCommand implements SimpleCommand { this.plugin.removePlayerFromCache(username); ((Player) source).disconnect(this.successful); } catch (SQLException e) { - source.sendMessage(this.errorOccurred); + source.sendMessage(this.errorOccurred, MessageType.SYSTEM); e.printStackTrace(); } } else { - source.sendMessage(this.wrongPassword); + source.sendMessage(this.wrongPassword, MessageType.SYSTEM); } return; } } - source.sendMessage(this.usage); + source.sendMessage(this.usage, MessageType.SYSTEM); } else { - source.sendMessage(this.notPlayer); + source.sendMessage(this.notPlayer, MessageType.SYSTEM); } } diff --git a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java index c2a0234..6a65e7f 100644 --- a/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java +++ b/src/main/java/net/elytrium/limboauth/handler/AuthSessionHandler.java @@ -44,6 +44,7 @@ import net.elytrium.limboauth.event.PostRegisterEvent; import net.elytrium.limboauth.event.TaskEvent; import net.elytrium.limboauth.migration.MigrationHash; import net.elytrium.limboauth.model.RegisteredPlayer; +import net.kyori.adventure.audience.MessageType; import net.kyori.adventure.bossbar.BossBar; import net.kyori.adventure.text.Component; import net.kyori.adventure.title.Title; @@ -204,7 +205,7 @@ public class AuthSessionHandler implements LimboSessionHandler { this.proxyPlayer.disconnect(databaseErrorKick); } - this.proxyPlayer.sendMessage(registerSuccessful); + this.proxyPlayer.sendMessage(registerSuccessful, MessageType.SYSTEM); if (registerSuccessfulTitle != null) { this.proxyPlayer.showTitle(registerSuccessfulTitle); } @@ -228,7 +229,7 @@ public class AuthSessionHandler implements LimboSessionHandler { this.sendMessage(true); } } else if (--this.attempts != 0) { - this.proxyPlayer.sendMessage(loginWrongPassword[this.attempts - 1]); + this.proxyPlayer.sendMessage(loginWrongPassword[this.attempts - 1], MessageType.SYSTEM); } else { this.proxyPlayer.disconnect(loginWrongPasswordKick); } @@ -256,17 +257,17 @@ public class AuthSessionHandler implements LimboSessionHandler { private void sendMessage(boolean sendTitle) { if (this.totpState) { - this.proxyPlayer.sendMessage(totp); + this.proxyPlayer.sendMessage(totp, MessageType.SYSTEM); if (sendTitle && totpTitle != null) { this.proxyPlayer.showTitle(totpTitle); } } else if (this.playerInfo == null) { - this.proxyPlayer.sendMessage(register); + this.proxyPlayer.sendMessage(register, MessageType.SYSTEM); if (sendTitle && registerTitle != null) { this.proxyPlayer.showTitle(registerTitle); } } else { - this.proxyPlayer.sendMessage(login[this.attempts - 1]); + this.proxyPlayer.sendMessage(login[this.attempts - 1], MessageType.SYSTEM); if (sendTitle && loginTitle != null) { this.proxyPlayer.showTitle(loginTitle); } @@ -285,7 +286,7 @@ public class AuthSessionHandler implements LimboSessionHandler { if (!Settings.IMP.MAIN.REGISTER_NEED_REPEAT_PASSWORD || args[1].equals(args[2])) { return true; } else { - this.proxyPlayer.sendMessage(registerDifferentPasswords); + this.proxyPlayer.sendMessage(registerDifferentPasswords, MessageType.SYSTEM); return false; } } @@ -293,10 +294,10 @@ public class AuthSessionHandler implements LimboSessionHandler { private boolean checkPasswordLength(String password) { int length = password.length(); if (length > Settings.IMP.MAIN.MAX_PASSWORD_LENGTH) { - this.proxyPlayer.sendMessage(registerPasswordTooLong); + this.proxyPlayer.sendMessage(registerPasswordTooLong, MessageType.SYSTEM); return false; } else if (length < Settings.IMP.MAIN.MIN_PASSWORD_LENGTH) { - this.proxyPlayer.sendMessage(registerPasswordTooShort); + this.proxyPlayer.sendMessage(registerPasswordTooShort, MessageType.SYSTEM); return false; } else { return true; @@ -305,7 +306,7 @@ public class AuthSessionHandler implements LimboSessionHandler { private boolean checkPasswordStrength(String password) { if (Settings.IMP.MAIN.CHECK_PASSWORD_STRENGTH && this.plugin.getUnsafePasswords().contains(password)) { - this.proxyPlayer.sendMessage(registerPasswordUnsafe); + this.proxyPlayer.sendMessage(registerPasswordUnsafe, MessageType.SYSTEM); return false; } else { return true; @@ -313,7 +314,7 @@ public class AuthSessionHandler implements LimboSessionHandler { } private void finishLogin() { - this.proxyPlayer.sendMessage(loginSuccessful); + this.proxyPlayer.sendMessage(loginSuccessful, MessageType.SYSTEM); if (loginSuccessfulTitle != null) { this.proxyPlayer.showTitle(loginSuccessfulTitle); } -- cgit