Skip to content
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_Shutdown does not unset Discord user's Playing status #61

Closed
EngiN33R opened this issue Nov 21, 2017 · 7 comments
Closed

Discord_Shutdown does not unset Discord user's Playing status #61

EngiN33R opened this issue Nov 21, 2017 · 7 comments

Comments

@EngiN33R
Copy link

For both the send-presence sample and our own integration, a call to Discord_Shutdown does not call the disconnect handler, and the Playing <game> status in Discord stays there for the user even after the process has been shut down. Calling Discord_UpdateConnection() and Discord_RunCallbacks() after Discord_Shutdown() (to really cover all our bases) didn't work either. The only fix for this is restarting Discord client-side; the RP status disappears then. Time doesn't seem to play a role either, as the RP just stays there.

The send-presence sample that was tested was taken from the 2.0.1 release of this repo. For our own integration, discord-rpc was compiled as a 32-bit DLL from the master source as of commit 5d5bc82 on a Win 7 64-bit machine:

cmake .. -DCMAKE_INSTALL_PREFIX=..\out -DBUILD_SHARED_LIBS=ON -DUSE_STATIC_CRT=ON -DENABLE_IO_THREAD=OFF -G "Visual Studio 14 2015"
@crmarsh
Copy link
Contributor

crmarsh commented Nov 21, 2017

Discord_Shutdown clears out the callback pointers so none of them are called, shuts down the io thread, and closes the connection to Discord. The intent was for this to get called as your game shuts down, but it is safe to call whenever and re-init later if you want.

Right now the Playing <game> status in Discord is driven by the process existing, not by the rpc connection. We're planning to add an explicit call to disable it, though.

@EngiN33R
Copy link
Author

But the process doesn't exist in my scenario. For example, this was taken 5 minutes after starting send-presence.exe, typing f into the prompt, and closing it as soon as Discord: ready was shown. As you can see, no send-presence process exists, but the RP info is still displayed with the time left having counted down to 00:00.

image

@No-Half-Measures
Copy link

No-Half-Measures commented Nov 21, 2017

Looking at the Send-Presence example 'Discord_Shutdown' is called twice when you 'quit' using the q input option it causes this issue, I actually did this in my own code too accidentally and had the same issue where the rich presence status was stuck displayed even though the process had closed after the 'Discord_Shutdown' function was called (all be it was twice).
After removing the second un-needed execution of the 'Discord_Shutdown' function and testing it seemed to have fixed it in my code/senario... Could this be an issue then with executing 'Discord_Shutdown' more than once? If that's the case even though you shouldn't there probably should be something stopping this issue from even happening in the first place.

@crmarsh
Copy link
Contributor

crmarsh commented Nov 21, 2017

Nah, Discord_Shutdown should be safe to call a second time. That sounds like a bug on Discord's side.

@crmarsh
Copy link
Contributor

crmarsh commented Nov 21, 2017

Fixed on canary and ptb, should get to stable soon.

@StrikerMan780
Copy link

Good that this is fixed. I thought I was going crazy.

@crmarsh
Copy link
Contributor

crmarsh commented Nov 22, 2017

Should be fixed in stable now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants