Apparently the Discord RPC doesn't like being run from the JAR, disabled until it can work

This commit is contained in:
Yair Morgenstern
2019-11-21 18:50:10 +02:00
parent 62fd7d8588
commit e00bdf77d6

View File

@ -41,6 +41,12 @@ internal object DesktopLauncher {
val game = UnCivGame("Desktop") 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 { try {
val handlers = DiscordEventHandlers() val handlers = DiscordEventHandlers()
DiscordRPC.INSTANCE.Discord_Initialize("647066573147996161", handlers, true, null) DiscordRPC.INSTANCE.Discord_Initialize("647066573147996161", handlers, true, null)
@ -48,7 +54,7 @@ internal object DesktopLauncher {
Runtime.getRuntime().addShutdownHook(Thread { DiscordRPC.INSTANCE.Discord_Shutdown() }) Runtime.getRuntime().addShutdownHook(Thread { DiscordRPC.INSTANCE.Discord_Shutdown() })
thread { thread {
while(true){ while (true) {
updateRpc(game) updateRpc(game)
Thread.sleep(1000) Thread.sleep(1000)
} }
@ -56,8 +62,6 @@ internal object DesktopLauncher {
} catch (ex: Exception) { } catch (ex: Exception) {
print("Could not initialize Discord") print("Could not initialize Discord")
} }
LwjglApplication(game, config)
} }
fun updateRpc(game: UnCivGame) { fun updateRpc(game: UnCivGame) {