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.
This commit is contained in:
simoleo89
2026-06-13 16:19:17 +02:00
parent 87e1ef94f7
commit ede7eb8284
3 changed files with 35 additions and 9 deletions
@@ -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";
@@ -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;
@@ -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));
}
}