From e00bdf77d62b7baf55b293a77893bc0bf82d32cd Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 21 Nov 2019 18:50:10 +0200 Subject: [PATCH] Apparently the Discord RPC doesn't like being run from the JAR, disabled until it can work --- desktop/src/com/unciv/app/desktop/DesktopLauncher.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt b/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt index b9a4c53771..73b33bc2e9 100644 --- a/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt +++ b/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt @@ -41,6 +41,12 @@ internal object DesktopLauncher { val game = UnCivGame("Desktop") +// tryActivateDiscord(game) // Deactivated until we can figure out how to make it work from the .jar + + LwjglApplication(game, config) + } + + private fun tryActivateDiscord(game: UnCivGame) { try { val handlers = DiscordEventHandlers() DiscordRPC.INSTANCE.Discord_Initialize("647066573147996161", handlers, true, null) @@ -48,7 +54,7 @@ internal object DesktopLauncher { Runtime.getRuntime().addShutdownHook(Thread { DiscordRPC.INSTANCE.Discord_Shutdown() }) thread { - while(true){ + while (true) { updateRpc(game) Thread.sleep(1000) } @@ -56,8 +62,6 @@ internal object DesktopLauncher { } catch (ex: Exception) { print("Could not initialize Discord") } - - LwjglApplication(game, config) } fun updateRpc(game: UnCivGame) {