Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script fails to launch DayZ #9

Closed
Ronkn opened this issue Apr 9, 2022 · 8 comments
Closed

Script fails to launch DayZ #9

Ronkn opened this issue Apr 9, 2022 · 8 comments
Labels

Comments

@Ronkn
Copy link

Ronkn commented Apr 9, 2022

I'm having an issue where the script won't launch DayZ. Looking at threads on reddit , it sounds as though it's a problem with steam. But just so others have this visibility, this is my output:

/home/frank/gaming/dayz-linux-cli-launcher/dayz-launcher.sh   --server 51.161.118.201:2402   --port 27600   --launch   --name frank
[dayz-launcher.sh][info] Resolving steam
[dayz-launcher.sh][info] Using non-flatpak mode: steam
[dayz-launcher.sh][info] Querying API for server: 51.161.118.201:27600
[dayz-launcher.sh][info] Launching DayZ
+ steam -applaunch 221100 '-mod=@1912237302-IRP_Land_Rover_Defender_110;@2158553597-Breachingcharge_Expansion_Compatibility;@1827241477-Breachingcharge;@2485015982-Radioactive_Animals;@1836257061-Banking;@2149462115-ZT_Vending_Machine;@1590841260-Trader;@1565871491-BuilderItems;@2350401726-King_of_the_Hill;@2303554682-Dogtags;@1646187754-Code_Lock;@2024889593-COCAs_NoVehicleDamageMOD;@2444247391-Inventory_Move_Sounds;@2501812949-Flying_Birds;@2470924704-Gas_Pump_Refueling;@2155726353-Mortys_Weapons;@2293907947-TruckSpeedFix;@1868236039-No_Glove_Or_Shoe_Damage;@2216645010-PristineRepair;@1797720064-WindstridesClothingPack;@1832448183-FlipTransport;@2098390861-No_Force_Weapon_Raise;@1932611410-CannabisPlus;@1991570984-MuchStuffPack;@2276010135-DayZ_Editor_Loader;@2545327648-Dabs_Framework;@2572331007-DayZ_Expansion_Bundle;@1566911166-Mass_sManyItemOverhaul;@2443122116-SNAFU_Weapons;@2754119488-CPBWeapons_Legacy;@1793351435-Remastered_Arma_Weapon_Pack;@1665082937-Trump_s_Wall_Server_Mod;@2116157322-DayZ_Expansion_Licensed;@1828439124-VPPAdminTools;@1564026768-Community_Online_Tools;@1559212036-CF' -connect=51.161.118.201:2402 -nolauncher -world=empty -name=frank
steam.sh[21055]: Running Steam on pop 20.04 64-bit
steam.sh[21055]: STEAM_RUNTIME is enabled automatically
setup.sh[21125]: Steam runtime environment up-to-date!
steam.sh[21055]: Steam client's requirements are satisfied

Then nothing happens. I've tried restarting steam, and I've tried only running:

steam -applaunch 221100 '-mod=@1912237302-IRP_Land_Rover_Defender_110;@2158553597-Breachingcharge_Expansion_Compatibility;@1827241477-Breachingcharge;@2485015982-Radioactive_Animals;@1836257061-Banking;@2149462115-ZT_Vending_Machine;@1590841260-Trader;@1565871491-BuilderItems;@2350401726-King_of_the_Hill;@2303554682-Dogtags;@1646187754-Code_Lock;@2024889593-COCAs_NoVehicleDamageMOD;@2444247391-Inventory_Move_Sounds;@2501812949-Flying_Birds;@2470924704-Gas_Pump_Refueling;@2155726353-Mortys_Weapons;@2293907947-TruckSpeedFix;@1868236039-No_Glove_Or_Shoe_Damage;@2216645010-PristineRepair;@1797720064-WindstridesClothingPack;@1832448183-FlipTransport;@2098390861-No_Force_Weapon_Raise;@1932611410-CannabisPlus;@1991570984-MuchStuffPack;@2276010135-DayZ_Editor_Loader;@2545327648-Dabs_Framework;@2572331007-DayZ_Expansion_Bundle;@1566911166-Mass_sManyItemOverhaul;@2443122116-SNAFU_Weapons;@2754119488-CPBWeapons_Legacy;@1793351435-Remastered_Arma_Weapon_Pack;@1665082937-Trump_s_Wall_Server_Mod;@2116157322-DayZ_Expansion_Licensed;@1828439124-VPPAdminTools;@1564026768-Community_Online_Tools;@1559212036-CF' -connect=51.161.118.201:2402 -nolauncher -world=empty -name=frank

But none of that changed the outcome. I'll follow up with a separate comment, containing your response from reddit

Distro:
Pop!_OS 20.04 LTS
Kernel:
5.16.11-76051611-generic
RAM:
32 GB
GPU Driver:
4.6 Mesa 21.2.2
GPU:
AMD Radeon R9 390 (HAWAII, DRM 3.44.0, 5.16.11-76051611-generic, LLVM 12.0.0)
CPU:
AMD Ryzen 7 3700X 8-Core
Proton: 7.0_1

@Ronkn
Copy link
Author

Ronkn commented Apr 9, 2022

Here was your response:

Then nothing happens.

As you can see, the launcher has done its job. Everything that comes next is up to Steam, so I can't really help here other than giving some suggestions according to my experience with Steam.

I've tried restarting steam, and I've tried only running: ...

I can't tell you how Steam manages its singleton process mechanism. There are many ways for achieving this, and since Steam is proprietary closed source software, nobody except Valve can tell. Restarting Steam should however fix the singleton process detection. If it does not, then check

  • if running steam -applaunch 221100 alone works
  • if Steam has actually received the command passed to it via the secondary launch attempt. Fully close Steam, run it from your command line shell to be able to see its stdout/stderr, and then run the command with the applaunch stuff again.
  • if there are any running stale/zombie steam process in the background which break the singleton process mechanism. If so, kill them or restart your system.
  • if there are any .steampid files with bad process ID references in your home directory. If so, fully close Steam and delete those files, then start Steam again and re-run the launcher.

Running Steam on pop 20.04 64-bit

It's also possible that something else is going on on PopOS / Ubuntu / Debian. If that's the case, then I can help, because I don't use Debian based distros. Steam is working perfectly fine on Arch.

Once again, the launcher's job is to set up mods and to generate a command line with parameters necessary to launch the game via steam, and as can be seen in the log output, it has done that. If Steam refuses to start the game, you can always add the generated parameters to your game's launch options in Steam itself. If the custom launch options in Steam don't include the %command% keyword, then the entire input will be appended to the game's launch command interpreted by BASH, which is what you want.


Asking questions about the launcher on reddit is also not a good idea. That should ideally be done on the issue tracker on github, so everyone else can see. This answer will only be seen by people coming to reddit and finding this old thread.

@Ronkn
Copy link
Author

Ronkn commented Apr 9, 2022

So I tried to run steam -applaunch 221100 with steam open, and it failed. I closed steam and ran it, and it launched steam AND DayZ but it ran the dayz client (containing the server browsing tab, that launches the game once the mods are downloaded automatically). That client does not function, which is why I'm using this script.

So, is there a way to get the script, or dayz in steam, to launch straight into the game and bypass that client?

@bastimeyer
Copy link
Owner

Thanks for reposting for visibility.

So I tried to run steam -applaunch 221100 with steam open, and it failed. I closed steam and ran it, and it launched steam AND DayZ but it ran the dayz client (containing the server browsing tab, that launches the game once the mods are downloaded automatically)

So it launched the official DayZ launcher, not the actual game client.

I forgot to tell that you need to pass the -nolauncher argument, so that the game starts the game client instead of the launcher. My launch script automatically sets the -nolauncher argument.

This should start the game client:

$ steam -applaunch 221100 -nolauncher
steam.sh[788431]: Running Steam on arch rolling 64-bit
steam.sh[788431]: STEAM_RUNTIME is enabled automatically
setup.sh[788505]: Steam runtime environment up-to-date!
steam.sh[788431]: Steam client's requirements are satisfied

Now that I'm on my computer again and had a quick look at the issue, I tried running your launch command, and it didn't work for me either.

According to this bug report on Steam-for-Linux's issue tracker, Steam seems to have issues with long launch commands, and it stops working:
ValveSoftware/steam-for-linux#5753

Since the main problem seems to be the long list of mods, you could try and short the mod links with the following diff:

diff --git a/dayz-launcher.sh b/dayz-launcher.sh
index 021695f..15bb31c 100755
--- a/dayz-launcher.sh
+++ b/dayz-launcher.sh
@@ -242,7 +242,7 @@ setup_mods() {
     local modname="$(gawk 'match($0,/name\s*=\s*"(.+)"/,m){print m[1];exit}' "${modmeta}")"
     [[ -n "${modname}" ]] || err "Missing mod name for: ${modid}"
     debug "Mod ${modid} found: ${modname}"
-    modlink="@${modid}-$(echo "${modname}" | sed -E 's/[^[:alpha:]0-9]+/_/g; s/^_|_$//g')"
+    modlink="@${modid}"
 
     if ! [[ -L "${dir_dayz}/${modlink}" ]]; then
       msg "Creating mod symlink for: ${modname} (${modlink})"

This only sets the mod ID in the mod directory links and thus shortens the -mod= launch parameter.

Make sure that you restart Steam prior to this.

@Ronkn
Copy link
Author

Ronkn commented Apr 9, 2022

Thanks for the response.

steam -applaunch 221100 -nolauncher

Running that just launches the game, without mods enabled. Do I need to somehow include this command with:

/home/frank/gaming/dayz-linux-cli-launcher/dayz-launcher.sh   --server 51.161.118.201:2402   --port 27600   --launch   --name frank

regarding your mod ID shortening code. The red is the existing and the green is the proposed change? Where would I implement this change? (BTW I'm no coder, but I can sometimes determine the intent of certain lines and make some changes. But I am very green to this.) Looks like it's found in your script file, starting with line 242? Do I simply remove that red line and add the green in it's place? (then reboot steam)

@bastimeyer
Copy link
Owner

Running that just launches the game, without mods enabled.

Yes, that was the intention. This shows that the arguments get passed to steam correctly and that the long command is the culprit here. As you can see, this doesn't include the rest of the generated launch parameters, like the long list of mods, your ingame name, etc.

BTW I'm no coder

Sorry about the confusion. It's a diff, and it means that you should replace the line

    modlink="@${modid}-$(echo "${modname}" | sed -E 's/[^[:alpha:]0-9]+/_/g; s/^_|_$//g')"

with

    modlink="@${modid}"

which essentially removes the name of the mod links. I posted the diff, because I'm interested whether shortening the mods list like this works for you. This comes at the cost of not being able to tell the mods apart (as a human).

Please run the script with the modifications applied, restart steam (just to be sure), and re-run the launcher, so that it generates a shorter mods launch parameter which steam will hopefully accept. If it does not, then my last idea is shortening the mod links further by converting the mod IDs into a string of ascii characters and converting that into a base64 string, which should save a couple more bytes.

Other than that, I guess it's up to steam to fix this. Or you'll have to set the generated launch parameters in the steam launch options manually, which should work.

@Ronkn
Copy link
Author

Ronkn commented Apr 9, 2022

That worked!!! It's launching straight into the modded server without issues.

Thank you so much for working through this with me. I've been playing dayz since 2014, and have about 2000 hours on it. I've been waiting for this day for so long.

@bastimeyer
Copy link
Owner

Nice to hear that it's working.
I'll push a change later to the master branch which will reduce the mod names further, so servers can be joined with lots of mods.

@Ronkn Ronkn closed this as completed Apr 9, 2022
bastimeyer added a commit that referenced this issue Apr 9, 2022
Resolves #9
Resolves #8

See ValveSoftware/steam-for-linux#5753

Steam seems to have issues with long launch arguments when calling it
via `steam -applaunch GAMEID ARGUMENTS`. This results in the client not
responding to any `-applaunch` attempts anymore, and it needs to be
restarted.

When trying to join servers with lots of mods, the `-mod=...` argument
can become too long for Steam to handle, so mod directories should not
be named by their mod ID and mod name and they should instead be kept as
short as possible. This comes at the cost of not being able to identify
mod directories easily anymore, but it's better than not being able to
join certain servers at all and having to restart Steam.

- Remove mod names from mod directory links
- Turn decimal mod IDs into ASCII char strings and convert to base64
@bastimeyer
Copy link
Owner

0.5.0 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants