-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discord Game SDK fails to initialize when Discord is not installed #52
Comments
Sadly, I don't know of any good cross-platform way to check if a program is installed. If you got any ideas, feel free to contribute them! |
I actually had the same idea to check for a running Discord process. Since some of my apps happen to only run on Windows, I can easily just implement a native solution to check for running processes and call it a day. Maybe that would make more sense to implement, also for cross-platform functionality. We can assume Discord is using the default process name like Or, more cross-platform friendly might be to talk to some port Discord which might be listening on and sending a message to it and getting a response. In this case we can implement it with standard Java sockets or so. I don't know the exact details of what Discord exposes though. |
There is a cross-platform way of checking if a process exists, which I originally used to skip my tests automatically for CI builds (https://github.com/JnCrMx/discord-game-sdk4j/blob/master/src/test/java/de/jcm/discordgamesdk/DiscordTest.java#L30). But sadly, it does not work in Java 8… Since the library already uses native code, it might be an idea to simply implement such a check in C and As for checking if the port is open… Currently, the library is basically just a wrapper around the C library provided by Discord. I don't want to rely on any “under the hood”-behavior of it. |
I tested this library on a machine which does not have Discord installed, it causes the following exception:
Is this the cause of not installing Discord? Since this error seems quite opaque, it would be great to know or maybe provide a
static boolean isDiscordInstalled()
so we can skip using the library entirely in this case.The text was updated successfully, but these errors were encountered: