OpenAsar / arrpc

Open Discord RPC server for atypical setups
https://arrpc.openasar.dev
MIT License
480 stars 71 forks source link

Game detection on Linux is very broken #74

Closed Sqaaakoi closed 6 months ago

Sqaaakoi commented 7 months ago

After some discoveries after a Vesktop user filed an issue that Minecraft Java wasn't being detected, I discovered a few major issues with how process detection works.

  1. The process checking code is only comparing the name, and not any arguments
  2. Some names in the detectable games list are prefixed with > to denote checking only the suffix (or last part of the path?) (on macOS, which arRPC doesn't check for platforms, and it shouldn't due to Linux entries not being present most games)
  3. The native getProcesses implementation just returns the full output of /proc/PID/cmdline, but with 0 replaced with nothing. /proc/PID/cmdline is actually an array of argv[] split by null bytes.

See https://github.com/Vencord/Vesktop/issues/481 for my research on this. I am currently taking a look at how I could fix this.

0xQueen commented 7 months ago

Not broken for me.

PolisanTheEasyNick commented 7 months ago

Broken for me

thembees commented 7 months ago

broken for me

image

Vesktop can connect to it, but out of 15 games none of them were detected.

sull324 commented 7 months ago

It never worked. i use this fork https://github.com/miathetrain/arrpc which work.

if your on arch you have to add an patch file you can find on the aur ,havent tryed it on other distro.

thembees commented 7 months ago

It never worked. i use this fork https://github.com/miathetrain/arrpc which work.

that branch seemingly does the same thing. Doesn't detect any games. image

if your on arch you have to add an patch file you can find on the aur ,havent tryed it on other distro.

I am on Arch, that's the patch? Nothing else comes up when I search for arrpc apart from arrpc and arrpc-git

sull324 commented 7 months ago

https://aur.archlinux.org/cgit/aur.git/tree/async.patch?h=arrpc-git

the patch in question.

thembees commented 7 months ago

thanks @sull324 , but to be honest I have no idea what to do with that, so I guess I'll just wait for it to get pushed to the main branch.

PolisanTheEasyNick commented 7 months ago

thanks @sull324 , but to be honest I have no idea what to do with that, so I guess I'll just wait for it to get pushed to the main branch.

You can check what PKGBUILD does. You need to clone fork repo: git clone https://github.com/miathetrain/arrpc Then cd to it: cd arrpc Download patch: wget https://aur.archlinux.org/cgit/aur.git/plain/async.patch?h=arrpc-git -O async.patch Patch and build package:

patch ./src/index.js async.patch
npm i esbuild pkg
npx esbuild --bundle --platform=node --target=node18 --outdir=dist ./src/index.js
npx pkg -t node18-linux-x64 -o arrpc  ./dist/index.js

And install it: install -D -m755 arrpc /usr/bin/arrpc Then restart service (I assume service is installed since you are using AUR version already): systemctl --user restart arrpc I didn't tested this commands explicitly so there may be errors. Also you can test another fork by issue creator, which already created PR for fixing this problem.

thembees commented 6 months ago

Thank you so much, but after applying the patch I get image

I think i'll wait for the package to be updated

NoiceFrog commented 3 months ago

hi, i am having the same issue on Arch Linux. Nothing gets detected. I have tried Lunar client, official Minecraft Launcher, Spotify, Xonotic, Steam games like Stardew Valley and Combat Master, VScode and Neovim (both with discord rpc plugins installed). The original issue was posted on April 3rd and it is still not fixed, this is really annoying, could you please fix it?