discord-api-docs
discord-api-docs copied to clipboard
Game SDK - main discord app running but no user logged in causes game to crash
Description
We're using Game SDK v.3.2.1 with Unity (only for rich presence functionality) - when the main Discord application is running but there is no user logged in the game crashes when trying to update activity: DiscordInstance.GetActivityManager().UpdateActivity()
We also didn't find a way to reliably check if the user is logged in before calling the UpdateAcitivity()
, attempts via userManager methods also resulted in a crash and userManager.OnCurrentUserUpdate +=
didn't work when user logged in after running the game + when logging out of the discord app while game was running.
Steps to Reproduce
- Run main discord app
- Log out but keep the app running
- Run a game using Unity Discord Game SDK with Rich Presence
- Game crashes on trying to update Rich Presence (UNKNOWN error while executing native code
Expected Behavior
Game doesn't crash when attempting to update activity when the discord main app is running but there's no user logged in or there is a reliable way to check if there is a user currently logged in.
Current Behavior
Runtime error and the game crashes (exception STATUS_HEAP_CORRUPTION / 0x7ffc4fb2f409: Fatal Error: STATUS_HEAP_CORRUPTION / 0x7ffc4fb2f409)
Screenshots/Videos
No response
Client and System Information
Windows, Unity game build, Discord Game SDK v.3.2.1