Closed GitMuslim closed 1 year ago
winediscordipcbridge-steam.sh: line 13: runtimecmd: bad array subscript
this is the issue from log. i guess that is the problem
I had this issue, I changed line 13 to
if [ ${#runtimecmd[@]} -ne 0 -a "${runtimecmd[-1]}" == "--" ]; then
and it worked like a charm ... I also didn't edit BRIDGE
, that worked fine with the dirname ${BASH_SOURCE[0]}
I might submit a pull request at some point, though if someone else gets to it first that's cool.
After playing around a little more I'm not convinced that fix will solve @ITZProGamerDieYT issue. It certainly gets rid of the log warning and I was seeing Discord report the game correctly, however I have since seen the game not being reported correctly, if I close and reopen Steam it usually sorts it out (I've tried it with and without my suggested fix and it does the same thing). Sorry for any false hope.
@ITZProGamerDieYT I have a few question, just to double check:
/home/<username>/wine-discord-ipc-bridge/winediscordipcbridge-steam.sh
or /home/<username>/wine-discord-ipc-bridge/winediscordipcbridge-steam.sh %command%
?edit: the game doesn't startup
I think I am having the same issue. I get the same line 13: runtimecmd: bad array subscript
error, and the game starts correctly, but Discord is not detecting the game. I tried changing line 13 in the wrapper script to
if [ ${#runtimecmd[@]} -ne 0 -a "${runtimecmd[-1]}" == "--" ]; then
and still got the same error.
I am running the game Deep Rock Galactic via Proton-6.20-GE-1. I am also running on ZFS, if that makes a difference.
I did some experiments tonight and found that I could get the bridge running alongside a game, Deep Rock Galactic, but I found that the bridge would die as the game came up. I added some debug to the bridge and found that it couldn't find /run/user/{userid}/discord-ipc-0 when calling connect(2). It turns out that steam now runs games in containers that don't get access to that path by default, but there are env var overrides so that it can. See: https://github.com/ValveSoftware/steam-runtime/blob/master/doc/steamlinuxruntime-known-issues.md#sharing-directories-with-the-container
By adding PRESSURE_VESSEL_FILESYSTEMS_RW="/run/user/{userid}" %command%
to the launch options that path is opened for read/write. Not sure if it needs that or RO / read-only, but I assume the socket needs to be written to.
Right now I have local changes to proton to just start the bridge before any game rather than use the script. I'd rather use the script than having local edits on proton, but I need to sit down and look at how bash is parsing all that. I had a hardcoded example that would have worked with this change, but I scraped it. Hopefully this helps you all! Discord showed Deep Rock Galactic connect and I could see updates to it in game. The join group button light up green on Discord, but I'll have to try it tomorrow.
I messed around with the bash script and something about running the bridge in a separate call to proton causes the game to pause or stall. Nothing seemed to get both running correctly. I noticed that the fix I added to the proton version I was using, Proton-6.20-GE-1, already existed in the form of PROTON_REMOTE_DEBUG_CMD. This had a typo in Proton-6.20-GE-1 where it tries to reference "wine54" rather than "wine64" and fails. Looks like this is fixed in Proton-6.21-GE-2 and I assume it works in Proton-6.3. https://github.com/GloriousEggroll/proton-ge-custom/blob/d5090ed5d6f99ed0f534326ed49df877358b8503/proton#L1435
Now I'm using PRESSURE_VESSEL_FILESYSTEMS_RW and PROTON_REMOTE_DEBUG_CMD in my launch options and the time seems to work fine for Deep Rock Galactic. This bridge is kind of like a debugger, right? It kind of fits. :smile:
Here's my current launch options, adding in the executable path and your user_id as needed. I believe most distro/systems have the first user as 1000 for the uid / user_id.
PROTON_REMOTE_DEBUG_CMD=/path/to/winediscordipcbridge.exe PRESSURE_VESSEL_FILESYSTEMS_RW="/run/user/{user_id}" %command%
Nice! That's hilarious, that specifying the bridge as a debug command works. Feel free to make a pull request updating the proton script or just adding what you've found to the README.
Gonna check that tommorow
PROTON_REMOTE_DEBUG_CMD=/path/to/winediscordipcbridge.exe PRESSURE_VESSEL_FILESYSTEMS_RW="/run/user/1000" %command%
This makes the miner's union show up, and the game opens a browser to log into discord, but the discord app still won't see the game.
the OS is manjaro, and the game is DRG.
Found it. Installed discord via snap, and the socket is in a different folder. Line 239 updated to, so it includes snap
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/snap.discord/discord-ipc-%d", temp_path, pipeNum);
Line 239 updated to, so it includes snap
Line 239 of what?
oh sorry, the main.c.
look into /run/user/{user_id}/ and look for the discord-ipc
file. Could be an argument instead of a hardcoded string
doesnt work lol
Nice! That's hilarious, that specifying the bridge as a debug command works. Feel free to make a pull request updating the proton script or just adding what you've found to the README.
Probably a bit late but at truckersmp-cli we've solved the problem with a helper script which starts everything from inside the container. While it's not possible to add processes (besides that debug command) to the container you're free to start as many as you like from inside. But this certainly needs preparation and isn't a "just start and it works solution" for existing games.
Found it. Installed discord via snap, and the socket is in a different folder. Line 239 updated to, so it includes snap
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/snap.discord/discord-ipc-%d", temp_path, pipeNum);
this unfortunately didnt work for me. what else do i have to change in order to get it to function? I unfortunately dont get what i need to do. it showed something like pressure_wrapper as the game im playing but then didnt do anything else
It also stopped working for me as well.
The proton script also needs to be aware of where the IPC socket is.
I updated the script and main.c to add the snap paths, let me know if it works or not. It works for me on Arch, although I haven't tried with steam running from snap.
still nothing on my end, but i could be approaching this wrong. is there a way you can make a new read me documenting how one would set all this up? perhaps im reading things wrong (likely scenario) but its kinda hard to follow what i gotta do when there are two different things for proton games.
is there a way you can make a new read me documenting how one would set all this up?
Let's discuss in #27.
rpc doesn't work
i added
/home/(myusername)/wine-discord-ipc-bridge/winediscordipcbridge-steam.sh
to launch options in steam i also editedBRIDGE
to/home/(myusername)/wine-discord-ipc-bridge/winediscordipcbridge.exe
but nothing works :confused:
it only works if i run it as a normal wine app