bastimeyer / dayz-linux-cli-launcher

DayZ Linux CLI Launcher
MIT License
86 stars 11 forks source link

Launcher unable to retrieve mod list #6

Closed ryanwalder closed 2 years ago

ryanwalder commented 2 years ago

I'm trying to connect to Sunnyvale #1 |Livonia|OG|Loot+|BBP|Raiding|KOTH|Group|Trader but it seems to be unable to retrieve the modlist:

~/git/dayz-linux-cli-launcher $ ./dayz-launcher.sh --server 172.111.51.21:2302 -p 27016
[dayz-launcher.sh][info] Resolving steam
[dayz-launcher.sh][info] Using non-flatpak mode: steam
[dayz-launcher.sh][info] Querying API for server: 172.111.51.21:27016
[dayz-launcher.sh][info] Nothing to do...
[dayz-launcher.sh][info] No mod-ID list, --server address, or --launch parameter set.
[dayz-launcher.sh][info] See --help for all the available options

Looking at the server on battlemetrics it seems to have some junk in the first 2 mod entries which I'm assuming are causing the issue.

I can confirm this server works fine in Windows using the DayZ SA Launcher.

bastimeyer commented 2 years ago

[dayz-launcher.sh][info] Querying API for server: 172.111.51.21:27016 [dayz-launcher.sh][info] Nothing to do...

This happens when the API response with the mod ID data was empty.

As mentioned in the readme, this is a limitation of the third party server API provided by daemonforge.dev that's being used by the launcher for querying the server data. This is nothing that can be fixed here other than not using that API, but that's currently not happening (see the readme), so I'm going to close the issue.

https://github.com/bastimeyer/dayz-linux-cli-launcher/blob/0.3.0/README.md#known-issues

You can however set the individual mod IDs instead of setting the --server parameter and querying the API. The mod IDs can be extracted from other sites like battlemetrics which you've already linked.

Since there's no API endpoint available on battlemetrics.com where you can easily extract the mod IDs by server address+port (which is the reason why daemonforge.dev is being used in the launcher), you need to extract the mod IDs in your web browser's dev tools like so:

Array.from(document.querySelectorAll("#serverPage dd > ul > li > a")).map(a => /\?id=(\d+)$/.exec(a.href)).filter(Boolean).map(m => Number(m[1])).join(" ")

This yields the following mod ID list:

69537698 1572541337 2303483532 1928118716 1688306459 2684115613 2592089401 2549035494 1912237302 1818957231 2239279715 1869021368 2273590683 2443122116 1797720064 1630943713 2425071577 1832448183 1734713776 2049002856 1991570984 2018887948 2345073965 1646187754 2307297070 1710977250 2607805287 2540095036 2291785546 2545327648 1559212036 2054775140 1314079816 1936941389 1701538125

As you already said, there are junk IDs in this list, so you'll have to filter and review them manually.

And since the --launch parameter will only make you connect to the server after launching the game when you've also set the --server parameter (which you need to avoid here), you either have to connect to the server address manually when the game has started, or you'll have to add the -connect=address custom DayZ parameter. Example:

./dayz-launcher.sh --debug modID1 modID2 modID3 -- -connect=172.111.51.21:2302