EmbarkStudios / discord-sdk

An open implementation of the Discord Game SDK in Rust
Apache License 2.0
150 stars 10 forks source link

Fix IPC socket location #21

Closed Nehliin closed 1 year ago

Nehliin commented 1 year ago

Checklist

Description of Changes

The /run/user/x/discord-ipc-y no longer seems as accurate as previously and fails to connect. /run/user/x/com.discordapp.Discord/discord-ipc-y does work though.

sudo netstat -l -p | rg /run/user/ still lists the old path though: unix 2 [ ACC ] STREAM LISTENING 586043 376511/Discord --ty /run/user/1000/discord-ipc-0 So I would expect to find the socket when running ls /run/user/1000 which I don't. I checked the file descriptors directly of the pid: ls /proc/376511/fd | rg 586043 and do find the socket: lrwx------@ 64 oskar 25 Nov 12:56  36 -> socket:[586043] Confirming it's a unix socket: sudo grep -slw 586043 /proc/net/* /proc/net/unix

I don't really now why that socket can't be found so instead of completely replacing I added it as a fallback. I suspect the same thing might be happening on Windows so want to confirm that before merging this. In that case I can fix Windows in the same pr.

Nehliin commented 1 year ago

Windows seems to work like before so won't change the named pipe logic

Jake-Shadle commented 1 year ago

Given that path I assume it's because you're running flatpak Discord, and now I'm misremembering if I ever tested against that.

Nehliin commented 1 year ago

Ah yes I am using flatpack

Nehliin commented 1 year ago

I can ignore the atty rustsec and fix the license issue but what do you want to do with the structopt issue? Should I migrate to clap in this pr or simply ignore it? @Jake-Shadle

Jake-Shadle commented 1 year ago

I'm migrating now, don't worry about it.