修复启动崩溃 + Banner升级为Spring Boot彩色版

- AntiNoInteractService: 删除Set.of()中重复的LOOM元素导致java.lang.IllegalArgumentException
- banner.txt: 替换旧v1.0.0纯文本Banner为Spring Boot ANSI彩色版
  ALUER红色+绿色 / ServerGuard金色+青色 / V5.0.0紫色
- ServerGuardService.printBanner(): 简化为补充信息行,Banner由banner.txt统一管理
This commit is contained in:
Peijun Zhao
2026-05-16 20:11:52 +08:00
parent f1f292a520
commit 7e55676775
3 changed files with 21 additions and 52 deletions
@@ -201,43 +201,14 @@ public class ServerGuardService implements CommandLineRunner {
// ─── Banner ────────────────────────────────────────
private void printBanner() {
// Banner 已由 src/main/resources/banner.txt 提供(Spring Boot 启动时自动渲染)
// 此处仅输出补充信息
boolean hasAgent = agentServer != null;
// ANSI 颜色码
final String GOLD = "";
final String CYAN = "";
final String GRAY = "";
final String GREEN = "";
final String PURP = "";
final String RST = "";
logger.info("");
logger.info("{}╔══════════════════════════════════════════════════════════════╗{}", GRAY, RST);
logger.info("{}║{} {}█████╗ ██╗ ██╗███████╗██████╗ {}███████╗██████╗ {} {}║{}", GRAY, GOLD, CYAN, GRAY, RST);
logger.info("{}║{} {}██╔══██╗██║ ██║██╔════╝██╔══██╗ {}██╔════╝██╔══██╗{} {}║{}", GRAY, GOLD, CYAN, GRAY, RST);
logger.info("{}║{} {}███████║██║ ██║█████╗ ██████╔╝ {}███████╗██████╔╝{} {}║{}", GRAY, GOLD, CYAN, GRAY, RST);
logger.info("{}║{} {}██╔══██║██║ ██║██╔══╝ ██╔══██╗ {}╚════██║██╔══██╗{} {}║{}", GRAY, GOLD, CYAN, GRAY, RST);
logger.info("{}║{} {}██║ ██║╚██████╔╝███████╗██║ ██║ {}███████║██║ ██║{} {}║{}", GRAY, GOLD, CYAN, GRAY, RST);
logger.info("{}║{} {}╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ {}╚══════╝╚═╝ ╚═╝{} {}║{}", GRAY, GOLD, CYAN, GRAY, RST);
logger.info("{}║{} {}║{}", GRAY, RST);
logger.info("{}║{} {}AI-Powered Minecraft PaperMC Server Protection {}V5.0.0 {}║{}", GRAY, GREEN, PURP, GRAY, RST);
logger.info("{}║{} {}135+ Security Modules │ 100% Anti-Cheat Coverage {}║{}", GRAY, PURP, GRAY, RST);
logger.info("{}╠══════════════════════════════════════════════════════════════╣{}", GRAY, RST);
logger.info("{}║{} Java: {} {}║{}", GRAY, String.format("%-36s", System.getProperty("java.version")), GRAY, RST);
logger.info("{}║{} Available CPUs: {}{} {}║{}", GRAY, String.format("%-32s", Runtime.getRuntime().availableProcessors()), GRAY, RST);
logger.info("{}║{} Max Memory: {}{} {}║{}", GRAY, String.format("%-32s", (Runtime.getRuntime().maxMemory() / (1024 * 1024)) + " MB"), GRAY, RST);
logger.info("Web Console: http://0.0.0.0:{}/", serverPort);
if (hasAgent) {
logger.info("{}║{} Agent WS: ws://0.0.0.0:{}/agent{} {}║{}", GRAY, serverPort, " ", GRAY, RST);
logger.info("Agent WS: ws://0.0.0.0:{}/agent", serverPort);
}
logger.info("{}║{} Web Console: http://0.0.0.0:{}{} {}║{}", GRAY, serverPort, " ", GRAY, RST);
logger.info("{}║{} DeepSeek AI: {}{} {}║{}", GRAY,
deepSeekClient.isEnabled() ? "enabled (" + config.getAi().getDeepseek().getModel() + ")" : "disabled",
deepSeekClient.isEnabled() ? "" : " ", GRAY, RST);
logger.info("{}║{} Mode: {} {}║{}", GRAY,
String.format("%-36s", hasAgent ? "Agent Server (WebSocket)" : "External Monitor"), GRAY, RST);
logger.info("{}╚══════════════════════════════════════════════════════════════╝{}", GRAY, RST);
logger.info("");
logger.info(" {}Type 'help' in the shell for full command reference.{}", GOLD, RST);
logger.info(" {}Access the web console at http://localhost:{}/{}", GOLD, serverPort, RST);
logger.info("Type 'help' in the shell for full command reference.");
logger.info("");
}