From 8913f5a6789c267787fb913f401bb41045c1415c Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 20 Dec 2024 01:38:22 +0100 Subject: [PATCH] Add initialization & final shutdown message --- .../de/staropensource/engine/base/Engine.kt | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt b/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt index a2ebcff..0ae957a 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt @@ -151,6 +151,24 @@ class Engine private constructor() { info = BuildInformation(loadPrefix = "sosengine-base") state = State.INITIALIZED + + // Print initialization message + logger.info(""" + _ _ + ___ ___ ___ / \\___ _ __ __ _(_)_ __ ___ + / __|/ _ \/ __| / / _ \ '_ \ / _` | | '_ \ / _ \ + \__ \ (_) \__ \/\_/ __/ | | | (_| | | | | | __/ + |___/\___/|___/\/ \___|_| |_|\__, |_|_| |_|\___| + The StarOpenSource Engine |___/ ${info?.versionString(semver = false) ?: ""} + + Welcome to the StarOpenSource Engine! + The engine is licensed under the GNU General Public + License v3 and is developed by our wonderful contributors + under the umbrella of the StarOpenSource Project. + + Consider contributing! + https://git.staropensource.de/StarOpenSource/Engine + """.trimIndent().trimEnd()) } catch (exception: Exception) { logger.crash("Engine failed to initialize", throwable = exception, fatal = true) throw EngineInitializationFailureException(exception) @@ -274,12 +292,27 @@ class Engine private constructor() { @JvmStatic private fun performShutdown(final: Boolean, crashed: Boolean = false) { state = State.SHUTTING_DOWN + val infoLocal: BuildInformation? = info // Run shutdown code Environment.unset() FileAccess.deleteScheduled() FileAccess.unsetDefaultPaths() info = null + + // Print shutdown message + if (final) + logger.info(""" + _ _ + ___ ___ ___ / \\___ _ __ __ _(_)_ __ ___ + / __|/ _ \/ __| / / _ \ '_ \ / _` | | '_ \ / _ \ + \__ \ (_) \__ \/\_/ __/ | | | (_| | | | | | __/ + |___/\___/|___/\/ \___|_| |_|\__, |_|_| |_|\___| + The StarOpenSource Engine |___/ ${infoLocal?.versionString(semver = false) ?: ""} + + Thank you for using the StarOpenSource Engine! + - The StarOpenSource Project & all engine contributors + """.trimIndent().trimEnd()) } }