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] Does not work on Godot 3 unless UnityNamedPipe is used #94

Closed
sitiom opened this issue Sep 7, 2020 · 7 comments
Closed

[BUG] Does not work on Godot 3 unless UnityNamedPipe is used #94

sitiom opened this issue Sep 7, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@sitiom
Copy link

sitiom commented Sep 7, 2020

Describe the bug
DiscordRpcClient fails to connect in Godot normally without using UnityNamedPipe

Log output:

INFO: Attempting a new connection
INFO: RPC Connection Started
TRCE: ============================
TRCE: Assembly:             DiscordRPC, Version=1.0.150.0, Culture=neutral, PublicKeyToken=null
TRCE: Enqueue Command: DiscordRPC.RPC.Commands.PresenceCommand
TRCE: Pipe:                 DiscordRPC.IO.ManagedNamedPipeClient
TRCE: Platform:             Microsoft Windows NT 6.2.9200.0
TRCE: applicationID:        752376874339926187
TRCE: targetPipe:           -1
TRCE: POLL_RATE:            1000
TRCE: _maxRtQueueSize:      512
TRCE: _maxRxQueueSize:      0
TRCE: ============================
TRCE: Connecting to the pipe through the DiscordRPC.IO.ManagedNamedPipeClient
TRCE: ManagedNamedPipeClient.Connection(-1)
TRCE: Connection Attempt 0 ()
INFO: Attempting to connect to discord-ipc-0
ERR : Failed connection to discord-ipc-0. The operation has timed out.
WARN: Tried to close a already closed pipe.
TRCE: Done. Result: True
TRCE: Skipping sandbox connection.
TRCE: Connection Attempt 1 ()
INFO: Attempting to connect to discord-ipc-1
ERR : Failed connection to discord-ipc-1. The operation has timed out.
WARN: Tried to close a already closed pipe.
TRCE: Done. Result: True
TRCE: Skipping sandbox connection.
TRCE: Connection Attempt 2 ()
INFO: Attempting to connect to discord-ipc-2
ERR : Failed connection to discord-ipc-2. The operation has timed out.
WARN: Tried to close a already closed pipe.
TRCE: Done. Result: True
TRCE: Skipping sandbox connection.
TRCE: Connection Attempt 3 ()
INFO: Attempting to connect to discord-ipc-3
ERR : Failed connection to discord-ipc-3. The operation has timed out.
WARN: Tried to close a already closed pipe.
TRCE: Done. Result: True
TRCE: Skipping sandbox connection.
TRCE: Connection Attempt 4 ()
INFO: Attempting to connect to discord-ipc-4
ERR : Failed connection to discord-ipc-4. The operation has timed out.
WARN: Tried to close a already closed pipe.
TRCE: Done. Result: True
TRCE: Skipping sandbox connection.
TRCE: Connection Attempt 5 ()
INFO: Attempting to connect to discord-ipc-5
ERR : Failed connection to discord-ipc-5. The operation has timed out.
WARN: Tried to close a already closed pipe.
TRCE: Done. Result: True
TRCE: Skipping sandbox connection.
TRCE: Connection Attempt 6 ()
INFO: Attempting to connect to discord-ipc-6
ERR : Failed connection to discord-ipc-6. The operation has timed out.
WARN: Tried to close a already closed pipe.
TRCE: Done. Result: True
TRCE: Skipping sandbox connection.
TRCE: Connection Attempt 7 ()
INFO: Attempting to connect to discord-ipc-7
ERR : Failed connection to discord-ipc-7. The operation has timed out.
WARN: Tried to close a already closed pipe.
TRCE: Done. Result: True
TRCE: Skipping sandbox connection.
TRCE: Connection Attempt 8 ()
INFO: Attempting to connect to discord-ipc-8
ERR : Failed connection to discord-ipc-8. Thread was being aborted.
WARN: Tried to close a already closed pipe.
ERR : Unhandled Exception: System.Threading.ThreadAbortException
ERR : Thread was being aborted.
ERR :   at DiscordRPC.IO.ManagedNamedPipeClient.AttemptConnection (System.Int32 pipe, System.Boolean isSandbox) [0x00168] in <be27f5d1995a470d9db1a68b5833f77c>:0 
  at DiscordRPC.IO.ManagedNamedPipeClient.Connect (System.Int32 pipe) [0x00059] in <be27f5d1995a470d9db1a68b5833f77c>:0 
  at DiscordRPC.RPC.RpcConnection.MainLoop () [0x001ee] in <be27f5d1995a470d9db1a68b5833f77c>:0

To Reproduce
Steps to reproduce the behavior:

  1. Create an empty Node2D Scene
  2. Attach a C# script
  3. Initialize DiscordRpcClient somewhere in the script

Desktop (please complete the following information):

  • OS: Windows 10 2004
  • Framework: .NET Framework 4.7.2
  • Version: 1.0.150

Additional context
Godot 3.2.3 Mono RC; Haven't tried in 3.2.2 but I think its the same case.

@sitiom sitiom added the bug Something isn't working label Sep 7, 2020
@Lachee Lachee self-assigned this Sep 7, 2020
@Lachee
Copy link
Owner

Lachee commented Sep 7, 2020

Hmm this might be a Mono Bug. So it works fine when using the UnityNamedPipe and the native dll with it?
If so, then it might be wise to rename that class to MonoNamedPipe instead.

@sitiom
Copy link
Author

sitiom commented Sep 7, 2020

Hmm this might be a Mono Bug. So it works fine when using the UnityNamedPipe and the native dll with it?

Yep

If so, then it might be wise to rename that class to MonoNamedPipe instead.

Might also make it a nuget package as well.

Edit: Tried Monogame, same case.

@Lachee
Copy link
Owner

Lachee commented Sep 7, 2020

Awesome thanks, ill look into updating it!

@GitMuslim
Copy link

GitMuslim commented Mar 22, 2021

I want to put a quick update on this, this DOES work on Godot Linux executable for some reason and I tried using 'UnityNamedPipe' as in the issue's name but I didn't know how to use it, I also tried seeing if this could be a Build Tool bug but no, I tried building it on windows and put it on Linux and it did work, but building it on Linux and puting it on windows doesn't work no matter what the Build Tool type is, either it's dotnet or VS BuildTools or Mono, But one thing is MSBuild (Mono) does work for me on Linux but not on windows, it prints (The SDK resolver type "DotNetMSBuildSdkResolver" failed to load) so that's the only thing I'm unsure about, so if you can help I would gladly appreciate it. :)

@sitiom
Copy link
Author

sitiom commented Sep 19, 2022

Related issue: godotengine/godot#36958

I'm back after 2 years, Godot 4 now uses .NET 6 which fixes this issue. Continued in #201

@sitiom sitiom closed this as completed Sep 19, 2022
@sitiom sitiom changed the title [BUG] Does not work on godot unless UnityNamedPipe is used [BUG] Does not work on Godot 3 unless UnityNamedPipe is used Sep 19, 2022
@GitMuslim
Copy link

lol nice

@GitMuslim
Copy link

lol nice

Tbh I don't even remember when I commented this

Anyhow cool that the issue is fixed, it took long but late better than never

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

3 participants