protonscr

Cant connect to server when using %command%

steamopen reviewed
ValveSoftware/steam-for-linux#3336 · opened 2014-05-31 by noriah · updated 2016-04-29 · 11 comments · github
Nnoriah 2014-05-31 github

When using %command% for a games launch options, and trying to connect to a source game, shell will raise the following error: /bin/sh: 0: Illegal option -t

This comes from the command line being formatted with the connect string before the actual command.
-c +connect 127.0.0.1:27015 "/home/wolf/Games/SteamApps/common/Counter-Strike_Source/hl2.sh" -game cstrike -steam

Is there any way to fix this other than replacing '/bin/sh' in steamclient.so with a fake script (ex. '/bin/ah') and handling the command in that script ourselves?

TTele42 2014-06-02 github

There are valid and useful reasons to be able to have launch options before %command%, if you don't need to put anything before the game being launched (like env variables), then do not have %command% in that option.

Nnoriah 2014-06-02 github

I don't agree. If those launch options are supposed to go with the hl2.sh script, being put Before the %command% makes them useless.
So if my launch options look like this: primusrun %command%, then the outcome will be
-c +connect 127.0.0.1:27015 primusrun "/home/wolf/Games/SteamApps/common/Counter-Strike_Source/hl2.sh" -game cstrike -steam, Making the +connect cause issues.
There is absolutely no reason for launch options, meant to be used on a command, to come before that command. Currently, everything that goes into the launch option box will always come after the +connect

Edit:
Also, I doubt it will help, but this is how I launch steam:

# run_steam
LOG_FILE="${HOME}/Games/SteamApps/log/"`date +%F_%H-%M-%S`".log"
STEAM_RUNTIME=1 /usr/bin/steam -console -developer %U > ${LOG_FILE}
TTele42 2014-06-02 github

@amreuland what you originally wrote was ambiguous, thank you for clarifying ... yeah, something's going wrong and it does not have the same behavior on my system. (Gentoo 64bit)

Nnoriah 2014-06-02 github

Sorry about that. Im running Ubuntu 12.04.4 LTS 64bit on Linux 3.11.0-22

Nnoriah 2014-11-24 github

Came back to this issue and decided to test it on multiple distributions and versions.

Ubuntu - 12.04, 12.10, 13.04
Fedora - 18, 19, 20
Mint - 16, 17
Linux Kernels used: 3.11, 3.12, 3.13

The issue showed on each of them.

I'm now using Ubuntu 14.04 on Linux 3.13.0-39 64bit.
I've also found other users having the same problem. One of them is linked right above this comment.

Cceribik 2014-11-24 github

This is also affecting me on Arch Linux.

AAnAkkk 2015-06-02 github

@davidw-valve : this is still happening, actually connecting to a server through Steam has never worked on the linux client when using %command%, which is needed for optimus laptops.

Nnoriah 2015-06-02 github

Edit - Removed shell change script.

AAnAkkk 2015-06-02 github

Modifying steamclient.so isn't really a good solution. On windows, VAC bans for modified dll files. It may not do on Linux, but it could.

Nnoriah 2015-06-02 github

Well, then you could also just modify the launch scripts (hl2.sh) or others to include primusrun.
Point is, we need a fix.
I also added a warning to my post, just in case.

@davidw-valve @gdrewb-valve This issue has been open for over a year now. Could we please have some valve response to it.

Ttruboxl 2016-01-20 github

Just found out this issue. I thought I was alone too. :)
Having to launch Source Mods with NVIDIA GPU directly cause problem too. See #4224

Maybe out of topic but the entire Steam thing is also very unfriendly towards launching Source Mods that will either cause VAC issues. See ValveSoftware/source-sdk-2013#364

@davidw-valve
Are you still working on these?

Nothing extracted yet.