From 2b8d0d6df890c1b2f6831c15189b27f53c691008 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:36:09 -0700 Subject: [PATCH] Adjust done message again (#11118) what paper now shows as level loading time is the time displayed by vanilla or spigot in the 'done' message the time in the done message is now the actual time since the servers Main class was initialized --- patches/server/Improved-Watchdog-Support.patch | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/patches/server/Improved-Watchdog-Support.patch b/patches/server/Improved-Watchdog-Support.patch index 4d3d108f8d..f8e16778f6 100644 --- a/patches/server/Improved-Watchdog-Support.patch +++ b/patches/server/Improved-Watchdog-Support.patch @@ -142,19 +142,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.status = this.buildServerStatus(); // Spigot start -+ // Paper start - move done tracking ++ // Paper start - Improved Watchdog Support + LOGGER.info("Running delayed init tasks"); + this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // run all 1 tick delay tasks during init, + // this is going to be the first thing the tick process does anyways, so move done and run it after + // everything is init before watchdog tick. + // anything at 3+ won't be caught here but also will trip watchdog.... + // tasks are default scheduled at -1 + delay, and first tick will tick at 1 -+ String doneTime = String.format(java.util.Locale.ROOT, "%.3fs", (double) (Util.getNanos() - serverStartTime) / 1.0E9D); + final long actualDoneTimeMs = System.currentTimeMillis() - org.bukkit.craftbukkit.Main.BOOT_TIME.toEpochMilli(); // Paper - Add total time -+ LOGGER.info("Done (tick thread startup: {}, total: {})! For help, type \"help\"", doneTime, String.format(java.util.Locale.ROOT, "%.3fs", actualDoneTimeMs / 1000.00D)); // Paper - Add total time -+ // Paper end -+ -+ org.spigotmc.WatchdogThread.tick(); // Paper ++ LOGGER.info("Done ({})! For help, type \"help\"", String.format(java.util.Locale.ROOT, "%.3fs", actualDoneTimeMs / 1000.00D)); // Paper - Add total time ++ org.spigotmc.WatchdogThread.tick(); ++ // Paper end - Improved Watchdog Support org.spigotmc.WatchdogThread.hasStarted = true; // Paper Arrays.fill( this.recentTps, 20 ); // Paper start - further improve server tick loop @@ -230,7 +228,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 String s = String.format(Locale.ROOT, "%.3fs", (double) j / 1.0E9D); - DedicatedServer.LOGGER.info("Done ({})! For help, type \"help\"", s); -+ //DedicatedServer.LOGGER.info("Done ({})! For help, type \"help\"", s); // Paper moved to after init ++ DedicatedServer.LOGGER.info("Done preparing level \"{}\" ({})", this.getLevelIdName(), s); // Paper - clarify startup log messages & add total time if (dedicatedserverproperties.announcePlayerAchievements != null) { ((GameRules.BooleanValue) this.getGameRules().getRule(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)).set(dedicatedserverproperties.announcePlayerAchievements, this.overworld()); // CraftBukkit - per-world }