Lachee / discord-rpc-unity

C# custom implementation for Discord Rich Presence. Unity package to easy add to your own games.
MIT License
39 stars 2 forks source link

[BUG] RPC only works in editor, not in build. #1

Open cryptogrounds opened 2 years ago

cryptogrounds commented 2 years ago

Describe the bug Seems to work just fine in the Editor. However, on build, it fails to get past the "[DRP] Discord Rich Presence intialized and connecting..." phase.

To Reproduce Steps to reproduce the behavior:

  1. Build for Windows x86_64, IL2CPP, .NET 4.x
  2. Run the .exe, doesn't show up on Discord.

Expected behavior The RPC should show up on Discord like it does when I run it in the editor.

Desktop (please complete the following information):

Additional context Regardless of the .dlls being in the Assets/Plugins folder or where they originally were when I imported the asset, it doesn't change the result.

Logs

[DRP] Starting Discord Rich Presence
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
DiscordManager:Initialize()

[DRP] Discord Rich Presence intialized and connecting...
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
DiscordManager:Initialize()
// Doesn't get past here.
cryptogrounds commented 2 years ago

Update: I am using Log Level Info instead of warning. Seems that none of the IPC Log's are being called in the build.

Editor: image

Build: image

cryptogrounds commented 2 years ago

Any updates on this? Trying to figure out whether I should switch to the native discord rpc till this has been fixed or wait. Thank you.

Lachee commented 2 years ago

Ill look into this tomorrow. Very busy IRL and cannot commit full time to my projects.

cryptogrounds commented 2 years ago

Very understandable, just wanted to check :) Thank you!

Lachee commented 2 years ago

Very understandable, just wanted to check :) Thank you!

Sorry, taking slightly longer than expected to look into this. Perhaps this is a case of the native named pipe package not being included properly with the IL2CPP? Does it work with a Mono backend for you?

cryptogrounds commented 2 years ago

Just tested it, appears it doesn't work with Mono backend. Log files get spammed with Created new NamedPipeClientStream 'discord-ipc-0' => '\\.\pipe\discord-ipc-0'.

Lachee commented 2 years ago

Just tested it, appears it doesn't work with Mono backend. Log files get spammed with Created new NamedPipeClientStream 'discord-ipc-0' => '\\.\pipe\discord-ipc-0'.

Hmm ok, so the package sounds like is broken and not using the native library properly.

cryptogrounds commented 2 years ago

I noticed on the appveyor site, the most recent build failed as of 7 days ago. Could this have anything to do with it? Should I try downloading https://github.com/Lachee/unity-named-pipes manually?

asradesigning commented 1 year ago

I have same problem my RPC is not updating on android build it is only working on editor.

Lachee commented 1 year ago

I have same problem my RPC is not updating on android build it is only working on editor.

This library doesn't support Android. I dont believe Discord actually supports Rich Presence on android yet either.

Dan-Banfield commented 1 year ago

I have same problem my RPC is not updating on android build it is only working on editor.

This library doesn't support Android. I dont believe Discord actually supports Rich Presence on android yet either.

Nah, it doesn't. RPC doesn't work on mobile :(.