From 181f563b8014a9349aa2dd09258130b279b5a29c Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Fri, 19 Feb 2021 09:55:41 -0300 Subject: [PATCH] wait server stop --- src/main/kotlin/com/github/creeper123123321/viaaas/VIAaaS.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/github/creeper123123321/viaaas/VIAaaS.kt b/src/main/kotlin/com/github/creeper123123321/viaaas/VIAaaS.kt index 752e902..0d6c6be 100644 --- a/src/main/kotlin/com/github/creeper123123321/viaaas/VIAaaS.kt +++ b/src/main/kotlin/com/github/creeper123123321/viaaas/VIAaaS.kt @@ -39,6 +39,7 @@ import us.myles.ViaVersion.api.Via import us.myles.ViaVersion.api.data.MappingDataLoader import us.myles.ViaVersion.api.protocol.ProtocolVersion import java.io.File +import java.lang.Thread import java.net.InetAddress import java.security.KeyPairGenerator import java.util.concurrent.CompletableFuture @@ -135,6 +136,7 @@ fun main(args: Array) { initFuture.complete(Unit) VIAaaSConsole.start() + while(runningServer) { Thread.sleep(1000L) } ktorServer?.stop(1000, 1000) httpClient.close() @@ -146,4 +148,4 @@ fun main(args: Array) { fun Application.mainWeb() { ViaWebApp().apply { main() } -} \ No newline at end of file +}