You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 15:36:17 +00:00
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:
@@ -65,17 +65,6 @@ public final class Emulator {
|
|||||||
"██║ ╚═╝ ██║╚██████╔╝██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝███████║ ██║ ██║ ██║██║ ██║\n" +
|
"██║ ╚═╝ ██║╚██████╔╝██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝███████║ ██║ ██║ ██║██║ ██║\n" +
|
||||||
"╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝\n" +
|
"╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝\n" +
|
||||||
"Still Rocking in 2026.\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 String build = "";
|
||||||
public static long buildTimestamp = -1L;
|
public static long buildTimestamp = -1L;
|
||||||
|
|
||||||
@@ -129,7 +118,7 @@ public final class Emulator {
|
|||||||
ConsoleCommand.load();
|
ConsoleCommand.load();
|
||||||
Emulator.logging = new Logging();
|
Emulator.logging = new Logging();
|
||||||
|
|
||||||
System.out.println(consoleLogo);
|
System.out.println(startupHero());
|
||||||
|
|
||||||
long startTime = System.nanoTime();
|
long startTime = System.nanoTime();
|
||||||
|
|
||||||
@@ -326,6 +315,27 @@ public final class Emulator {
|
|||||||
"+----------------------------------------------------------------+\n";
|
"+----------------------------------------------------------------+\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) {
|
private static String formatBuildTimestamp(long buildTimestamp, String timezoneId) {
|
||||||
if (buildTimestamp <= 0) {
|
if (buildTimestamp <= 0) {
|
||||||
return "UNKNOWN";
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user