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): improve universal console layout
Keep the Morningstar ASCII logo while using a structured plain-text startup card that works in CMD, Windows Terminal, and other consoles without ANSI support. Compact the Logback console pattern to use simple class names, clean separators, and a wider message column so startup logs do not wrap as aggressively. Simplify Infostand startup output to a one-line asset count while preserving category breakdown at DEBUG level. Also normalize generic server start/stop messages so Game Server and RCON Server are labeled correctly instead of being glued to host:port output.
This commit is contained in:
@@ -317,6 +317,12 @@ public final class Emulator {
|
|||||||
|
|
||||||
static String startupHero() {
|
static String startupHero() {
|
||||||
return "\n" +
|
return "\n" +
|
||||||
|
" __ __ ___ ____ _ _ ___ _ _ ____ ____ _____ _ ____ \n" +
|
||||||
|
" | \\/ |/ _ \\| _ \\| \\ | |_ _| \\ | |/ ___/ ___|_ _|/ \\ | _ \\ \n" +
|
||||||
|
" | |\\/| | | | | |_) | \\| || || \\| | | _\\___ \\ | | / _ \\ | |_) |\n" +
|
||||||
|
" | | | | |_| | _ <| |\\ || || |\\ | |_| |___) || |/ ___ \\| _ < \n" +
|
||||||
|
" |_| |_|\\___/|_| \\_\\_| \\_|___|_| \\_|\\____|____/ |_/_/ \\_\\_| \\_\\\n" +
|
||||||
|
"\n" +
|
||||||
"+------------------------------------------------------------------------------+\n" +
|
"+------------------------------------------------------------------------------+\n" +
|
||||||
"| MORNINGSTAR EXTENDED |\n" +
|
"| MORNINGSTAR EXTENDED |\n" +
|
||||||
"| Arcturus game server runtime |\n" +
|
"| Arcturus game server runtime |\n" +
|
||||||
|
|||||||
+7
-2
@@ -96,6 +96,12 @@ public class InfostandBackgroundManager {
|
|||||||
this.entries.get(Category.OVERLAY).size(),
|
this.entries.get(Category.OVERLAY).size(),
|
||||||
this.entries.get(Category.CARD).size(),
|
this.entries.get(Category.CARD).size(),
|
||||||
this.entries.get(Category.BORDER).size()));
|
this.entries.get(Category.BORDER).size()));
|
||||||
|
LOGGER.debug("Infostand Background Manager assets: {} bg, {} stands, {} overlays, {} cards, {} borders",
|
||||||
|
this.entries.get(Category.BACKGROUND).size(),
|
||||||
|
this.entries.get(Category.STAND).size(),
|
||||||
|
this.entries.get(Category.OVERLAY).size(),
|
||||||
|
this.entries.get(Category.CARD).size(),
|
||||||
|
this.entries.get(Category.BORDER).size());
|
||||||
} else {
|
} else {
|
||||||
LOGGER.info("InfostandBackgroundManager -> infostand_backgrounds is empty, server-side validation disabled (only range clamp will apply).");
|
LOGGER.info("InfostandBackgroundManager -> infostand_backgrounds is empty, server-side validation disabled (only range clamp will apply).");
|
||||||
}
|
}
|
||||||
@@ -103,8 +109,7 @@ public class InfostandBackgroundManager {
|
|||||||
|
|
||||||
static String summary(int backgrounds, int stands, int overlays, int cards, int borders) {
|
static String summary(int backgrounds, int stands, int overlays, int cards, int borders) {
|
||||||
int total = backgrounds + stands + overlays + cards + borders;
|
int total = backgrounds + stands + overlays + cards + borders;
|
||||||
return String.format("Infostand Background Manager -> Loaded! (%d assets: %d bg, %d stands, %d overlays, %d cards, %d borders)",
|
return String.format("Infostand Background Manager -> Loaded! (%d assets)", total);
|
||||||
total, backgrounds, stands, overlays, cards, borders);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUse(Habbo habbo, Category category, int id) {
|
public boolean canUse(Habbo habbo, Category category, int id) {
|
||||||
|
|||||||
@@ -85,10 +85,10 @@ public abstract class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!channelFuture.isSuccess()) {
|
if (!channelFuture.isSuccess()) {
|
||||||
LOGGER.info("Failed to connect to the host ({}:{})@{}", this.host, this.port, this.name);
|
LOGGER.info("Failed to start {} on {}:{}", this.name, this.host, this.port);
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
} else {
|
} else {
|
||||||
LOGGER.info("Started GameServer on {}:{}@{}", this.host, this.port, this.name);
|
LOGGER.info("Started {} on {}:{}", this.name, this.host, this.port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ public abstract class Server {
|
|||||||
} catch(InterruptedException e) {
|
} catch(InterruptedException e) {
|
||||||
LOGGER.error("Exception during {} shutdown... HARD STOP", this.name, e);
|
LOGGER.error("Exception during {} shutdown... HARD STOP", this.name, e);
|
||||||
}
|
}
|
||||||
LOGGER.info("GameServer Stopped!");
|
LOGGER.info("Stopped {}", this.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerBootstrap getServerBootstrap() {
|
public ServerBootstrap getServerBootstrap() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>%d{HH:mm:ss.SSS} [%-14thread] %-5level %-36logger{36} - %msg%n</pattern>
|
<pattern>%d{HH:mm:ss.SSS} %-5level [%-12thread] %-22logger{0} | %msg%n</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.eu.habbo;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
class ConsoleLogbackLayoutTest {
|
||||||
|
@Test
|
||||||
|
void consolePatternKeepsStartupMessagesReadable() throws Exception {
|
||||||
|
String logback = Files.readString(Path.of("src/main/resources/logback.xml"));
|
||||||
|
|
||||||
|
assertTrue(logback.contains("%-22logger{0}"), "console should show compact class names");
|
||||||
|
assertTrue(logback.contains("| %msg%n"), "console should leave a clear message column");
|
||||||
|
assertFalse(logback.contains("%-36logger{36}"), "wide package loggers waste console space");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ class EmulatorStartupConsoleTest {
|
|||||||
void startupHeroUsesUniversalAsciiLayout() {
|
void startupHeroUsesUniversalAsciiLayout() {
|
||||||
String hero = Emulator.startupHero();
|
String hero = Emulator.startupHero();
|
||||||
|
|
||||||
|
assertTrue(hero.contains("__ __ ___ ____"));
|
||||||
assertTrue(hero.contains("MORNINGSTAR EXTENDED"));
|
assertTrue(hero.contains("MORNINGSTAR EXTENDED"));
|
||||||
assertTrue(hero.contains("Version"));
|
assertTrue(hero.contains("Version"));
|
||||||
assertTrue(hero.contains("Build"));
|
assertTrue(hero.contains("Build"));
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class InfostandBackgroundManagerTest {
|
|||||||
@Test
|
@Test
|
||||||
void summaryKeepsStartupLogCompact() {
|
void summaryKeepsStartupLogCompact() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"Infostand Background Manager -> Loaded! (260 assets: 188 bg, 22 stands, 9 overlays, 16 cards, 25 borders)",
|
"Infostand Background Manager -> Loaded! (260 assets)",
|
||||||
InfostandBackgroundManager.summary(188, 22, 9, 16, 25));
|
InfostandBackgroundManager.summary(188, 22, 9, 16, 25));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user