From ede7eb8284b71bf9eda986dec61cc04c0f149be6 Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sat, 13 Jun 2026 16:19:17 +0200 Subject: [PATCH] style(startup): tidy console banner logs Shorten the infostand background startup message into a compact asset summary and print the project/version/build details as a single ASCII startup card instead of several timestamped log lines. Add a small contract test for the compact infostand summary format. --- .../src/main/java/com/eu/habbo/Emulator.java | 20 ++++++++++++------- .../infostand/InfostandBackgroundManager.java | 10 ++++++++-- .../InfostandBackgroundManagerTest.java | 14 +++++++++++++ 3 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 Emulator/src/test/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManagerTest.java diff --git a/Emulator/src/main/java/com/eu/habbo/Emulator.java b/Emulator/src/main/java/com/eu/habbo/Emulator.java index de1a4e86..b6ee12a3 100644 --- a/Emulator/src/main/java/com/eu/habbo/Emulator.java +++ b/Emulator/src/main/java/com/eu/habbo/Emulator.java @@ -154,13 +154,7 @@ public final class Emulator { Emulator.config.register("camera.render.delay", "5"); Emulator.config.register("hotel.timezone", java.time.ZoneId.systemDefault().getId()); String hotelTimezoneId = Emulator.getConfig().getValue("hotel.timezone", java.time.ZoneId.systemDefault().getId()); - System.out.println(); - LOGGER.info("https://github.com/duckietm/Arcturus-Morningstar-Extended, "); - System.out.println(); - LOGGER.info("This project is for educational purposes only. This Emulator is an open-source fork of Arcturus created by TheGeneral."); - LOGGER.info("Version: {}", version); - LOGGER.info("Build: {}", build); - LOGGER.info("Build Timestamp: {} [{}]", formatBuildTimestamp(buildTimestamp, hotelTimezoneId), hotelTimezoneId); + System.out.println(startupCard(hotelTimezoneId)); Emulator.texts.register("camera.permission", "You don't have permission to use the camera!"); Emulator.texts.register("camera.wait", "Please wait %seconds% seconds before making another picture."); Emulator.texts.register("camera.error.creation", "Failed to create your picture. *sadpanda*"); @@ -310,6 +304,18 @@ public final class Emulator { return -1L; } + static String startupCard(String hotelTimezoneId) { + return "\n" + + "+----------------------------------------------------------------+\n" + + "| Arcturus Morningstar Extended |\n" + + "| Source : github.com/duckietm/Arcturus-Morningstar-Extended |\n" + + "| Scope : Educational open-source fork by TheGeneral |\n" + + "| Version: " + version + "\n" + + "| Build : " + build + "\n" + + "| Time : " + formatBuildTimestamp(buildTimestamp, hotelTimezoneId) + " [" + hotelTimezoneId + "]\n" + + "+----------------------------------------------------------------+\n"; + } + private static String formatBuildTimestamp(long buildTimestamp, String timezoneId) { if (buildTimestamp <= 0) { return "UNKNOWN"; 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 8217bbfe..125635a9 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 @@ -90,17 +90,23 @@ public class InfostandBackgroundManager { this.enforce = loaded > 0; if (this.enforce) { - LOGGER.info("InfostandBackgroundManager -> Loaded {} backgrounds, {} stands, {} overlays, {} cards, {} borders from infostand_backgrounds.", + LOGGER.info(summary( 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()); + this.entries.get(Category.BORDER).size())); } else { LOGGER.info("InfostandBackgroundManager -> infostand_backgrounds is empty, server-side validation disabled (only range clamp will apply)."); } } + 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); + } + public boolean canUse(Habbo habbo, Category category, int id) { if (id == 0) return true; if (!this.enforce) return true; 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 new file mode 100644 index 00000000..93db4bf1 --- /dev/null +++ b/Emulator/src/test/java/com/eu/habbo/habbohotel/users/infostand/InfostandBackgroundManagerTest.java @@ -0,0 +1,14 @@ +package com.eu.habbo.habbohotel.users.infostand; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class InfostandBackgroundManagerTest { + @Test + void summaryKeepsStartupLogCompact() { + assertEquals( + "Infostand Background Manager -> Loaded! (260 assets: 188 bg, 22 stands, 9 overlays, 16 cards, 25 borders)", + InfostandBackgroundManager.summary(188, 22, 9, 16, 25)); + } +}