style(startup): use universal console splash

Replace the temporary ASCII-art banner with a structured startup splash that uses plain ASCII, aligned fields, and no ANSI or terminal-specific features. This keeps the emulator startup readable across CMD, PowerShell, Linux terminals, Docker logs, CI output, and copied log files. Add a contract test to keep the splash universal.
This commit is contained in:
simoleo89
2026-06-13 16:34:29 +02:00
parent 16d89cdb31
commit ea55258979
2 changed files with 40 additions and 12 deletions
@@ -65,17 +65,6 @@ public final class Emulator {
"██║ ╚═╝ ██║╚██████╔╝██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝███████║ ██║ ██║ ██║██║ ██║\n" +
"╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝\n" +
"Still Rocking in 2026.\n";
private static final String consoleLogo =
"\n" +
"============================================================\n" +
" __ __ ___ ____ _ _ ___ _ _ ____ ____ _____ _ ____ \n" +
" | \\/ |/ _ \\| _ \\| \\ | |_ _| \\ | |/ ___/ ___|_ _|/ \\ | _ \\ \n" +
" | |\\/| | | | | |_) | \\| || || \\| | | _\\___ \\ | | / _ \\ | |_) |\n" +
" | | | | |_| | _ <| |\\ || || |\\ | |_| |___) || |/ ___ \\| _ < \n" +
" |_| |_|\\___/|_| \\_\\_| \\_|___|_| \\_|\\____|____/ |_/_/ \\_\\_| \\_\\\n" +
" Arcturus Morningstar Extended - 2026\n" +
"============================================================\n";
public static String build = "";
public static long buildTimestamp = -1L;
@@ -129,7 +118,7 @@ public final class Emulator {
ConsoleCommand.load();
Emulator.logging = new Logging();
System.out.println(consoleLogo);
System.out.println(startupHero());
long startTime = System.nanoTime();
@@ -326,6 +315,27 @@ public final class Emulator {
"+----------------------------------------------------------------+\n";
}
static String startupHero() {
return "\n" +
"+------------------------------------------------------------------------------+\n" +
"| MORNINGSTAR EXTENDED |\n" +
"| Arcturus game server runtime |\n" +
"+------------------------------------------------------------------------------+\n" +
"| Version : " + fit(version, 63) + " |\n" +
"| Build : " + fit(build.isBlank() ? "UNKNOWN" : build, 63) + " |\n" +
"| Runtime : " + fit("Java " + System.getProperty("java.version", "unknown") + " / universal console output", 63) + " |\n" +
"+------------------------------------------------------------------------------+\n";
}
private static String fit(String value, int width) {
String safe = value == null ? "" : value;
if (safe.length() > width) {
return safe.substring(0, Math.max(0, width - 3)) + "...";
}
return String.format("%-" + width + "s", safe);
}
private static String formatBuildTimestamp(long buildTimestamp, String timezoneId) {
if (buildTimestamp <= 0) {
return "UNKNOWN";
@@ -0,0 +1,18 @@
package com.eu.habbo;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
class EmulatorStartupConsoleTest {
@Test
void startupHeroUsesUniversalAsciiLayout() {
String hero = Emulator.startupHero();
assertTrue(hero.contains("MORNINGSTAR EXTENDED"));
assertTrue(hero.contains("Version"));
assertTrue(hero.contains("Build"));
assertFalse(hero.contains("\u001B["), "startup hero must not require ANSI support");
}
}