mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
Apparently the Discord RPC doesn't like being run from the JAR, disabled until it can work
This commit is contained in:
@ -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) {
|
||||||
|
Reference in New Issue
Block a user