From c4b4465d51470e6aa95e3879bd0f89c20b741c4f Mon Sep 17 00:00:00 2001 From: Moritz Ruth Date: Tue, 15 Dec 2020 18:22:52 +0100 Subject: [PATCH] Add IntelliJ run configurations --- .gitignore | 5 +---- .runConfigurations/Clean.run.xml | 21 +++++++++++++++++++ .runConfigurations/Generate.run.xml | 21 +++++++++++++++++++ .runConfigurations/Run.run.xml | 15 +++++++++++++ .../main/kotlin/space/blokk/BlokkServer.kt | 7 +++++-- 5 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 .runConfigurations/Clean.run.xml create mode 100644 .runConfigurations/Generate.run.xml create mode 100644 .runConfigurations/Run.run.xml diff --git a/.gitignore b/.gitignore index 91f67b7..bff1709 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ .gradle/ build/ !src/**/build - -/serverData/ - /buildSrcTemp/ - +/serverData/ generatedKotlin/ diff --git a/.runConfigurations/Clean.run.xml b/.runConfigurations/Clean.run.xml new file mode 100644 index 0000000..0984f5f --- /dev/null +++ b/.runConfigurations/Clean.run.xml @@ -0,0 +1,21 @@ + + + + + + + true + + + \ No newline at end of file diff --git a/.runConfigurations/Generate.run.xml b/.runConfigurations/Generate.run.xml new file mode 100644 index 0000000..1907bf1 --- /dev/null +++ b/.runConfigurations/Generate.run.xml @@ -0,0 +1,21 @@ + + + + + + + true + + + \ No newline at end of file diff --git a/.runConfigurations/Run.run.xml b/.runConfigurations/Run.run.xml new file mode 100644 index 0000000..46d06a7 --- /dev/null +++ b/.runConfigurations/Run.run.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/blokk-server/src/main/kotlin/space/blokk/BlokkServer.kt b/blokk-server/src/main/kotlin/space/blokk/BlokkServer.kt index 49fb7a9..fce3418 100644 --- a/blokk-server/src/main/kotlin/space/blokk/BlokkServer.kt +++ b/blokk-server/src/main/kotlin/space/blokk/BlokkServer.kt @@ -3,7 +3,8 @@ package space.blokk import com.sksamuel.hoplite.ConfigFilePropertySource import com.sksamuel.hoplite.ConfigLoader import com.sksamuel.hoplite.ConfigSource -import kotlinx.coroutines.launch +import kotlinx.coroutines.cancel +import kotlinx.coroutines.runBlocking import space.blokk.config.BlokkConfig import space.blokk.event.EventBus import space.blokk.event.EventTargetGroup @@ -93,7 +94,9 @@ class BlokkServer internal constructor() : Server { } override fun shutdown() { - scope.launch { + scope.cancel("Shutdown") + + runBlocking { scheduler.shutdown() } }