From 78c5ab5d8a396c2eda9c259ecb917612b1615a16 Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Fri, 29 Sep 2023 15:02:18 +0800 Subject: [PATCH] Add banner color switch option & advanced banners --- src/main/java/fr/xephi/authme/AuthMe.java | 14 +++++++------- .../settings/properties/SecuritySettings.java | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index f02205c4..484819af 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -134,13 +134,13 @@ public class AuthMe extends JavaPlugin { logger = ConsoleLoggerFactory.get(AuthMe.class); logger.info("You are running an unofficial fork version of AuthMe!"); if(settings.getProperty(SecuritySettings.SHOW_STARTUP_BANNER)) { - logger.info("\n" + "|\\ __ \\|\\ \\|\\ \\|\\___ ___\\\\ \\|\\ \\|\\ _ \\ _ \\|\\ ___ \\ \n" + - "\\ \\ \\|\\ \\ \\ \\\\\\ \\|___ \\ \\_\\ \\ \\\\\\ \\ \\ \\\\\\__\\ \\ \\ \\ __/| \n" + - " \\ \\ __ \\ \\ \\\\\\ \\ \\ \\ \\ \\ \\ __ \\ \\ \\\\|__| \\ \\ \\ \\_|/__ \n" + - " \\ \\ \\ \\ \\ \\ \\\\\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\_|\\ \\ \n" + - " \\ \\__\\ \\__\\ \\_______\\ \\ \\__\\ \\ \\__\\ \\__\\ \\__\\ \\ \\__\\ \\_______\\\n" + - " \\|__|\\|__|\\|_______| \\|__| \\|__|\\|__|\\|__| \\|__|\\|_______|\n" + - " "); + String loadColorConfig = settings.getProperty(SecuritySettings.STARTUP_BANNER_COLOR); + logger.info("\n"+"§"+loadColorConfig+" ___ __ __ __ ___ \n" + + "§"+loadColorConfig+" / | __ __/ /_/ /_ / |/ /__ \n" + + "§"+loadColorConfig+" / /| |/ / / / __/ __ \\/ /|_/ / _ \\\n" + + "§"+loadColorConfig+" / ___ / /_/ / /_/ / / / / / / __/\n" + + "§"+loadColorConfig+"/_/ |_\\__,_/\\__/_/ /_/_/ /_/\\___/ \n" + + "§"+loadColorConfig+" "); } // Check server version diff --git a/src/main/java/fr/xephi/authme/settings/properties/SecuritySettings.java b/src/main/java/fr/xephi/authme/settings/properties/SecuritySettings.java index 715bea43..6899231d 100644 --- a/src/main/java/fr/xephi/authme/settings/properties/SecuritySettings.java +++ b/src/main/java/fr/xephi/authme/settings/properties/SecuritySettings.java @@ -77,6 +77,11 @@ public final class SecuritySettings implements SettingsHolder { public static final Property SHOW_STARTUP_BANNER = newProperty("Plugin.banners.showBanners", true); + @Comment("Should we show the Authme banner on startup?") + public static final Property STARTUP_BANNER_COLOR = + newProperty("Plugin.banners.bannerColor", "r"); + + @Comment("Max allowed tries before a captcha is required") public static final Property MAX_LOGIN_TRIES_BEFORE_CAPTCHA = newProperty("Security.captcha.maxLoginTry", 8);