Add banner color switch option & advanced banners

This commit is contained in:
HaHaWTH 2023-09-29 15:02:18 +08:00
parent 836c568fef
commit 78c5ab5d8a
2 changed files with 12 additions and 7 deletions

View File

@ -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

View File

@ -77,6 +77,11 @@ public final class SecuritySettings implements SettingsHolder {
public static final Property<Boolean> SHOW_STARTUP_BANNER =
newProperty("Plugin.banners.showBanners", true);
@Comment("Should we show the Authme banner on startup?")
public static final Property<String> STARTUP_BANNER_COLOR =
newProperty("Plugin.banners.bannerColor", "r");
@Comment("Max allowed tries before a captcha is required")
public static final Property<Integer> MAX_LOGIN_TRIES_BEFORE_CAPTCHA =
newProperty("Security.captcha.maxLoginTry", 8);