Add initialization & final shutdown message
This commit is contained in:
parent
e4f4ab6f8c
commit
8913f5a678
1 changed files with 33 additions and 0 deletions
|
@ -151,6 +151,24 @@ class Engine private constructor() {
|
||||||
info = BuildInformation(loadPrefix = "sosengine-base")
|
info = BuildInformation(loadPrefix = "sosengine-base")
|
||||||
|
|
||||||
state = State.INITIALIZED
|
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) {
|
} catch (exception: Exception) {
|
||||||
logger.crash("Engine failed to initialize", throwable = exception, fatal = true)
|
logger.crash("Engine failed to initialize", throwable = exception, fatal = true)
|
||||||
throw EngineInitializationFailureException(exception)
|
throw EngineInitializationFailureException(exception)
|
||||||
|
@ -274,12 +292,27 @@ class Engine private constructor() {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
private fun performShutdown(final: Boolean, crashed: Boolean = false) {
|
private fun performShutdown(final: Boolean, crashed: Boolean = false) {
|
||||||
state = State.SHUTTING_DOWN
|
state = State.SHUTTING_DOWN
|
||||||
|
val infoLocal: BuildInformation? = info
|
||||||
|
|
||||||
// Run shutdown code
|
// Run shutdown code
|
||||||
Environment.unset()
|
Environment.unset()
|
||||||
FileAccess.deleteScheduled()
|
FileAccess.deleteScheduled()
|
||||||
FileAccess.unsetDefaultPaths()
|
FileAccess.unsetDefaultPaths()
|
||||||
info = null
|
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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue