diff --git a/Emulator/src/main/java/com/eu/habbo/Emulator.java b/Emulator/src/main/java/com/eu/habbo/Emulator.java index 38fb74e9..fe88ec9a 100644 --- a/Emulator/src/main/java/com/eu/habbo/Emulator.java +++ b/Emulator/src/main/java/com/eu/habbo/Emulator.java @@ -317,6 +317,12 @@ public final class Emulator { static String startupHero() { return "\n" + + " __ __ ___ ____ _ _ ___ _ _ ____ ____ _____ _ ____ \n" + + " | \\/ |/ _ \\| _ \\| \\ | |_ _| \\ | |/ ___/ ___|_ _|/ \\ | _ \\ \n" + + " | |\\/| | | | | |_) | \\| || || \\| | | _\\___ \\ | | / _ \\ | |_) |\n" + + " | | | | |_| | _ <| |\\ || || |\\ | |_| |___) || |/ ___ \\| _ < \n" + + " |_| |_|\\___/|_| \\_\\_| \\_|___|_| \\_|\\____|____/ |_/_/ \\_\\_| \\_\\\n" + + "\n" + "+------------------------------------------------------------------------------+\n" + "| MORNINGSTAR EXTENDED |\n" + "| Arcturus game server runtime |\n" + diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManager.java index 125635a9..3e2805c8 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManager.java @@ -96,6 +96,12 @@ public class InfostandBackgroundManager { this.entries.get(Category.OVERLAY).size(), this.entries.get(Category.CARD).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 { 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) { 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)", - total, backgrounds, stands, overlays, cards, borders); + return String.format("Infostand Background Manager -> Loaded! (%d assets)", total); } public boolean canUse(Habbo habbo, Category category, int id) { diff --git a/Emulator/src/main/java/com/eu/habbo/networking/Server.java b/Emulator/src/main/java/com/eu/habbo/networking/Server.java index 61258f2d..ec24c314 100644 --- a/Emulator/src/main/java/com/eu/habbo/networking/Server.java +++ b/Emulator/src/main/java/com/eu/habbo/networking/Server.java @@ -85,10 +85,10 @@ public abstract class Server { } 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); } 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) { LOGGER.error("Exception during {} shutdown... HARD STOP", this.name, e); } - LOGGER.info("GameServer Stopped!"); + LOGGER.info("Stopped {}", this.name); } public ServerBootstrap getServerBootstrap() { diff --git a/Emulator/src/main/resources/logback.xml b/Emulator/src/main/resources/logback.xml index f4a62d3f..5a972548 100644 --- a/Emulator/src/main/resources/logback.xml +++ b/Emulator/src/main/resources/logback.xml @@ -2,7 +2,7 @@ - %d{HH:mm:ss.SSS} [%-14thread] %-5level %-36logger{36} - %msg%n + %d{HH:mm:ss.SSS} %-5level [%-12thread] %-22logger{0} | %msg%n @@ -65,4 +65,4 @@ - \ No newline at end of file + diff --git a/Emulator/src/test/java/com/eu/habbo/ConsoleLogbackLayoutTest.java b/Emulator/src/test/java/com/eu/habbo/ConsoleLogbackLayoutTest.java new file mode 100644 index 00000000..0f044868 --- /dev/null +++ b/Emulator/src/test/java/com/eu/habbo/ConsoleLogbackLayoutTest.java @@ -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"); + } +} diff --git a/Emulator/src/test/java/com/eu/habbo/EmulatorStartupConsoleTest.java b/Emulator/src/test/java/com/eu/habbo/EmulatorStartupConsoleTest.java index 629c2390..4e86f21e 100644 --- a/Emulator/src/test/java/com/eu/habbo/EmulatorStartupConsoleTest.java +++ b/Emulator/src/test/java/com/eu/habbo/EmulatorStartupConsoleTest.java @@ -10,6 +10,7 @@ class EmulatorStartupConsoleTest { void startupHeroUsesUniversalAsciiLayout() { String hero = Emulator.startupHero(); + assertTrue(hero.contains("__ __ ___ ____")); assertTrue(hero.contains("MORNINGSTAR EXTENDED")); assertTrue(hero.contains("Version")); assertTrue(hero.contains("Build")); diff --git a/Emulator/src/test/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManagerTest.java b/Emulator/src/test/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManagerTest.java index 93db4bf1..531ed49e 100644 --- a/Emulator/src/test/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManagerTest.java +++ b/Emulator/src/test/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManagerTest.java @@ -8,7 +8,7 @@ class InfostandBackgroundManagerTest { @Test void summaryKeepsStartupLogCompact() { 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)); } }