muttleyxd / arma3-unix-launcher

Launcher for Linux and Mac ArmA 3
MIT License
210 stars 43 forks source link

Steam no longer generates launch commands the same as direct_launch() #279

Open DrymarchonShaun opened 3 months ago

DrymarchonShaun commented 3 months ago

I was jumping around the code trying to figure out why the game is refusing to launch without disabling steam integration, and noticed that the command the direct_launch() function produces to run the game no longer reflects the command steam uses to launch the game. Not sure if it has anything to do with the game refusing to launch, but it seemed worth noting. I don't think I know enough c++ to properly update it to generate the same command steam uses.

all launch commands were formatted for readability

/home/shaun/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=107410 -- \
/home/shaun/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- \
/home/shaun/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/_v2-entry-point --verb=waitforexitandrun -- \
/home/shaun/.local/share/Steam/steamapps/common/Proton 7.0/proton waitforexitandrun \
/home/shaun/.local/share/Steam/steamapps/common/Arma 3/arma3launcher.exe

The first two commands seem to be the same for every game launched from steam (minus differing appids)

/home/shaun/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=107410 -- \
/home/shaun/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- \
...

SteamLinuxRuntime seems to be a sort of successor to the original steam-runtime. Best I can tell, the version that gets used depends on the proton version. It wasn't used prior to 5.13, but with 5.13 SteamLinuxRuntime_soldier was introduced and used until Proton 7.0. Then with Proton 8.0 they updated to SteamLinuxRuntime_sniper and have been using it since.

Proton 5.0 or older
...
/home/shaun/.local/share/Steam/steamapps/common/Proton 5.0/proton waitforexitandrun \
/home/shaun/.local/share/Steam/steamapps/common/Arma 3/arma3launcher.exe

Proton 5.13 to 7.0
...
/home/shaun/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/_v2-entry-point --verb=waitforexitandrun -- \
/home/shaun/.local/share/Steam/steamapps/common/Proton 7.0/proton waitforexitandrun \
/home/shaun/.local/share/Steam/steamapps/common/Arma 3/arma3launcher.exe

Proton 8.0 or newer
...
'/home/shaun/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- \
'/home/shaun/.local/share/Steam/steamapps/common/Proton 9.0 (Beta)'/proton waitforexitandrun \
'/home/shaun/.local/share/Steam/steamapps/common/Arma 3/arma3launcher.exe

Going to keep messing around to see if I can come up with something.

muttleyxd commented 3 months ago

Thanks for this research, I don't know if I'll be able to fix it for now as I don't have too much time to investigate and test.

DrymarchonShaun commented 3 months ago

Semi related question - I see there's a build-and-test-no-steamworks check run on pull requests - Does that build not require the Steamworks SDK at all? I'm assuming steam integration is disabled by default in that build?

Right now, I'm using

diff --git a/src/arma3-unix-launcher/mainwindow.cpp b/src/arma3-unix-launcher/mainwindow.cpp
index 66b73cc..f89f66b 100644
--- a/src/arma3-unix-launcher/mainwindow.cpp
+++ b/src/arma3-unix-launcher/mainwindow.cpp
@@ -56,6 +56,3 @@ MainWindow::MainWindow(std::unique_ptr<ARMA3::Client> arma3_client, std::filesys
 {
-    if (use_steam_integration)
-        steam_integration = std::make_unique<Steam::SteamIntegration>(ARMA3::Definitions::app_id);
-    else
-        steam_integration = std::make_unique<Steam::IntegrationStub>(ARMA3::Definitions::app_id);
+    steam_integration = std::make_unique<Steam::IntegrationStub>(ARMA3::Definitions::app_id);

diff --git a/src/dayz-linux-launcher/mainwindow.cpp b/src/dayz-linux-launcher/mainwindow.cpp
index d9223db..5773593 100644
--- a/src/dayz-linux-launcher/mainwindow.cpp
+++ b/src/dayz-linux-launcher/mainwindow.cpp
@@ -56,6 +56,3 @@ MainWindow::MainWindow(std::unique_ptr<DayZ::Client> arma3_client, std::filesyst
 {
-    if (use_steam_integration)
-        steam_integration = std::make_unique<Steam::SteamIntegration>(DayZ::Definitions::app_id);
-    else
-        steam_integration = std::make_unique<Steam::IntegrationStub>(DayZ::Definitions::app_id);
+    steam_integration = std::make_unique<Steam::IntegrationStub>(DayZ::Definitions::app_id);

to disable steam integration entirely, is there a better way to do it?

muttleyxd commented 3 months ago

Well, this build name should be updated as all builds now include Steam integration. But yeah, if you want your builds to not have Steam integration, then this is the way, however starting the launcher with -d parameter should disable it as well.