mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
shutdown: await log
This fixes that the help is not printed when providing invalid arguments
This commit is contained in:
parent
8ebe09f9eb
commit
95996ccb9d
@ -70,6 +70,7 @@ object Minosoft {
|
||||
fun main(args: Array<String>) {
|
||||
val start = nanos()
|
||||
Log::class.java.forceInit()
|
||||
ShutdownManager.addHook { Log.await() }
|
||||
CommandLineArguments.parse(args)
|
||||
Log.log(LogMessageType.OTHER, LogLevels.INFO) { "Starting minosoft..." }
|
||||
|
||||
|
@ -46,6 +46,7 @@ import de.bixilon.minosoft.protocol.network.connection.status.StatusConnection
|
||||
import de.bixilon.minosoft.protocol.network.network.client.netty.NettyClient
|
||||
import de.bixilon.minosoft.protocol.protocol.ProtocolDefinition
|
||||
import de.bixilon.minosoft.protocol.protocol.buffers.OutByteBuffer
|
||||
import de.bixilon.minosoft.terminal.RunConfiguration
|
||||
import de.bixilon.minosoft.util.account.microsoft.MicrosoftOAuthUtils
|
||||
import de.bixilon.minosoft.util.json.Jackson
|
||||
import de.bixilon.minosoft.util.url.ResourceURLHandler
|
||||
@ -293,7 +294,9 @@ object KUtil {
|
||||
}
|
||||
}
|
||||
ShutdownManager += {
|
||||
Platform.exit()
|
||||
if (!RunConfiguration.DISABLE_EROS) {
|
||||
Platform.exit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,10 +114,7 @@ object Log {
|
||||
return false
|
||||
}
|
||||
val setLevel = levels?.get(type) ?: LogLevels.INFO
|
||||
if (setLevel.ordinal < level.ordinal) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return setLevel.ordinal < level.ordinal
|
||||
}
|
||||
|
||||
fun log(type: LogMessageType, level: LogLevels = LogLevels.INFO, additionalPrefix: ChatComponent? = null, message: Any?, vararg formatting: Any) {
|
||||
@ -191,4 +188,10 @@ object Log {
|
||||
}
|
||||
log(type, additionalPrefix = null, messageBuilder = messageBuilder)
|
||||
}
|
||||
|
||||
fun await() {
|
||||
while (this.QUEUE.isNotEmpty()) {
|
||||
Thread.sleep(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user