Closed n1klas4008 closed 11 months ago
Hi,
it is intentional behavior of the underlying native library to terminate the application if Discord is not running (and it will then try to relaunch the application via Discord). I do not completely understand why Discord decided to do it like that (and imho a hard call to exit(3) in a library code is very bad practice), but that is just how the library behaves.
However, you can disable this behavior by using CreateParams.Flags.NO_REQUIRE_DISCORD
in the CreateParams
when creating the Core
. See my comment on #30 for more details.
You can also try using the new java-impl
branch (which does not have this behavior and should also work better with Discord running with Flatpak).
I hope this helps :D
thanks alot for the quick response, will alter Core accordingly - might also switch the branch but what are the differences to java-impl?
The java-impl
branch reimplements the entire functionality of the SDK's native library (the underlying protocol is quite simple).
It does not support Networking and stuff like that, but this functionality was removed by Discord (sadly) anyway.
Besides that it is almost feature complete (except getCurrentUserPremiumType()
in UserManager
, because I could not figure out how to implement that).
The advantages of this branch are that it does not require you to download/ship Discord's native library and that it should support Flatpak and Snap installations of Discord (which afaik Discord's native library does not). It also does not include weird behavior like closing your app if Discord is not running ;)
I have added this library to a project of mine and for a user on Linux Mint he gets this error message (presumably german)
Is it intentional for the whole application to get killed when this happens, I would assume RPC just would not connect/start/display while the application remains running but this just completly terminates Java
Discord was installed via Flatpack not sure if this makes a difference but adding this for context