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

[BUG] Initializing doesn't initialize client #197

Open
Nanolocity opened this issue Jul 20, 2022 · 5 comments
Open

[BUG] Initializing doesn't initialize client #197

Nanolocity opened this issue Jul 20, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@Nanolocity
Copy link

Nanolocity commented Jul 20, 2022

My program de-initializes the client if a certain function is started and then initializes it again if it knows that it's uninitialized and it needs it to be active but it doesn't re-initialize itself.

To Reproduce
Steps to reproduce the behavior:

  1. De-initialize client
  2. Wait a few seconds(until the presence is gone from the user's profile)
  3. Try to initialize client
  4. There aren't any errors, Rich Presence doesn't appear on user's profile.

Expected behavior
Client gets re-initialized after being de-initialized a few seconds prior due to a setting in the program being changed.

Desktop (please complete the following information):

  • OS: Windows 10
  • Framework: .Net 5
  • Library Version: 1.0.175

Additional context
Add any other context about the problem here.

Logs

No errors, warning, info, nothing even with level set to info

Code

if (json.DRPMode == false && client.IsInitialized)
            {
                Trace.WriteLine("killed client");
                client.ClearPresence();
                client.Deinitialize();
            }
            else if (json.DRPMode == true && !client.IsInitialized)
            client.Initialize();

I checked if it returns true or false and it managed to send a message in console when DRPMode was changed to true so it's not about the program not being able to read the DRPMode checkbox's state.

@Nanolocity Nanolocity added the bug Something isn't working label Jul 20, 2022
@Lachee
Copy link
Owner

Lachee commented Jul 21, 2022

Initialize will start the presence, but you will need to call SetPresence to actually set it.
If that still doesnt work ensure the Game ACtivity is enabled in your discord client.

@Nanolocity
Copy link
Author

Initialize will start the presence, but you will need to call SetPresence to actually set it. If that still doesnt work ensure the Game ACtivity is enabled in your discord client.

I have a function that automatically sets the presence every second, the only check it does before it does so is if the client is initialized or not.

@Nanolocity
Copy link
Author

Also the GameActivity feature is turned on within Discord as the activity appears if I launch the application again without de-initializing the client

@Nanolocity
Copy link
Author

I checked it and it's trying to update the presence, it's not throwing any errors but the Rich Presence/Game Activity isn't active on my profile either

@Nanolocity
Copy link
Author

Alright then, the issue is clear; initializing the client after it's been de-initialized just doesn't work OR it might be something else, if you know a solution please help @Lachee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants