Lachee / discord-rpc-csharp

C# custom implementation for Discord Rich Presence. Not deprecated and still available!
MIT License
591 stars 98 forks source link

Linux support should be possible #53

Closed ghost closed 5 years ago

ghost commented 5 years ago

If it works in the original discord-rpc library made in c++ why wouldnt it work in c#.

Just make a seperate thingy designed for the Linux operating system.

I belive in you.

Lachee commented 5 years ago

It should be Linux ready, I just have no easy way to test it yet at the moment. It is MacOS compatible so it shoooould be Linux compatible since they both just use Unix pipes.

ghost commented 5 years ago

@Lachee Ok. For testing you can just install MonoDevelop on a Linux VM. I would recommend either Ubuntu or Debian for that purpose

Agrair commented 5 years ago

I think the C++ version of Discord's official library has native mono support built in. The thing is though, to use the C++ binary in C#, the DllImport attribute only works on Windows, and 32bit processes at that.

ghost commented 5 years ago

I think the C++ version of Discord's official library has native mono support built in. The thing is though, to use the C++ binary in C#, the DllImport attribute only works on Windows, and 32bit processes at that.

Its possible. You just import the discord-rpc .so file with DllImport and it does work. https://www.mono-project.com/docs/advanced/pinvoke/

Lachee commented 5 years ago

I think the C++ version of Discord's official library has native mono support built in. The thing is though, to use the C++ binary in C#, the DllImport attribute only works on Windows, and 32bit processes at that.

Its possible. You just import the discord-rpc .so file with DllImport and it does work. https://www.mono-project.com/docs/advanced/pinvoke/

This library doesnt use the discord-rpc.so. Its a managed library written entirely in C# using managed named pipes. It should just work directly with Mono. The only use of DllImport is for the Unity Package and isn't in the actual DiscordRPC.dll.

ghost commented 5 years ago

@Lachee I know. What im saying is that in case it wouldnt work with mono directly you could just make a c# wrapper of the c++ library

egordorichev commented 5 years ago

Hey guys, I would love to help you with testing, on my current Linux setup the log produces some errors:

INFO: Attempting a new connection
INFO: Attempting to connect to /run/user/1000/discord-ipc-0
ERR : Failed connection to /run/user/1000/discord-ipc-0. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.
INFO: Attempting to connect to /run/user/1000/discord-ipc-1
ERR : Failed connection to /run/user/1000/discord-ipc-1. Asynchronous pipe mode is not supported
WARN: Tried to close a already closed pipe.

And etc, all pipes fail.

ghost commented 5 years ago

@egordorichev Thank you. This is exactly what i meant. It might be fixable but if it isnt, the simplest solution is too make a wrapper for the c++ library

ghost commented 5 years ago

@Lachee could you look into it? (@egordorichev's test)

Lachee commented 5 years ago

Moved to a new issue.

PJB3005 commented 5 years ago

For what it's worth, on my Linux system it works out of the box now.

Mono 5.18.1 x64, fwiw.