@@ -330,12 +330,15 @@ applyServerFiltres() {
330
330
' Oficial Server' ' Moded' " Mods < $DAYZ_FILTER_MOD_LIMIT ..."
331
331
' Without Password' ' First Person' ' Day Time' ' With BattlEye'
332
332
' With Players' " Players > $DAYZ_FILTER_PLAYERS_LIMIT % ..." ' Not Full'
333
- ' Filter by Map ...'
334
333
# Second page
335
334
' Not Oficial Server' ' Not Moded' " Mods > $DAYZ_FILTER_MOD_LIMIT ..."
336
335
' With Password' ' Third Person' ' Night Time' ' Without BattlEye'
337
336
' Without Players' " Players < $DAYZ_FILTER_PLAYERS_LIMIT % ..." ' Full'
337
+ # Third page
338
338
" Player slots ≥ $DAYZ_FILTER_PLAYERS_SLOTS ..."
339
+ ' Filter by Top of Maps ...' ' Filter by Map Name ...'
340
+ ' Filter by Top of Mods ...' ' Filter by Mod ID ...' ' Filter by Mod Name ...'
341
+ ' Linux Servers' ' Windows Servers'
339
342
) filters=()
340
343
341
344
# '✅ Oficial Server' '🛠️ Moded' "⬆️ Mods > $DAYZ_FILTER_MOD_LIMIT"
@@ -345,10 +348,11 @@ applyServerFiltres() {
345
348
# '❌ Not Oficial Server' '⚙️ Not Moded' "⬇️ Mods < $DAYZ_FILTER_MOD_LIMIT"
346
349
# '🔒 With Password' '👥 Third Person' '🌙 Night Time' '⚠️ Without BattlEye'
347
350
# '💤 Without Players' "📉 Players < $DAYZ_FILTER_PLAYERS_LIMIT%" '🚫 Full'
351
+ # '🐧 Linux Servers' '🪟 Windows Servers'
348
352
349
353
while read -u 3 -r filter; do
350
354
case $filter in
351
- ' Filter by Map ' * )
355
+ ' Filter by Top of Maps ' * )
352
356
map=$( gum choose --height=" $(( $(tput lines)- 8 )) " < <(
353
357
jq -er '
354
358
.result | map(.map) |
@@ -357,6 +361,15 @@ applyServerFiltres() {
357
361
' " $DAYZ_SERVER_DB "
358
362
) )
359
363
filters+=(" .value.map==\" $map \" " );;
364
+ ' Filter by Top of Mods' * )
365
+ mod_top=$( gum choose --height=" $(( $(tput lines)- 8 )) " < <(
366
+ jq -er '
367
+ .result | map(.mods[].name) |
368
+ reduce .[] as $i ({};setpath([$i]; getpath([$i]) + 1)) |
369
+ to_entries | sort_by(.value) | reverse[] | .key
370
+ ' " $DAYZ_SERVER_DB "
371
+ ) )
372
+ filters+=(" .value.mods[].name==\" $mod_top \" " );;
360
373
' Oficial Server' ) filters+=(' .value.shard=="public"' );;
361
374
' Not Oficial Server' ) filters+=(' .value.shard!="public"' );;
362
375
' Moded' ) filters+=(' .value.mods | length > 0' );;
@@ -371,6 +384,8 @@ applyServerFiltres() {
371
384
' Full' ) filters+=(' .value.players >= .value.maxPlayers' );;
372
385
' With BattlEye' ) filters+=(' .value.battlEye' );;
373
386
' Without BattlEye' ) filters+=(' .value.battlEye==false' );;
387
+ ' Linux Servers' ) filters+=(' .value.environment=="l"' );;
388
+ ' Windows Servers' ) filters+=(' .value.environment!="l"' );;
374
389
' Day Time' ) filters+=(
375
390
' def d:(.value.time | split(":")[0] | tonumber); d >= 6 and d <= 18'
376
391
);;
@@ -411,18 +426,39 @@ applyServerFiltres() {
411
426
--char-limit 3 --value " $DAYZ_FILTER_PLAYERS_SLOTS "
412
427
) "
413
428
filters+=(" .value.maxPlayers >= $count " );;
429
+ ' Filter by Map Name' * )
430
+ request_map=" $(
431
+ gum input --prompt ' Part or exact map name: ' \
432
+ --char-limit 256 --value ' Utes'
433
+ ) "
434
+ filters+=(" .value.map | test(\" ${request_map,,} \" ; \" i\" )" );;
435
+ ' Filter by Mod ID' * )
436
+ request_mod=" $(
437
+ gum input --prompt ' Part or exact ID for a mod from the workshop: ' \
438
+ --char-limit 10 --value ' 3098891860'
439
+ ) "
440
+ filters+=(" .value.mods[].steamWorkshopId | contains($request_mod )" );;
441
+ ' Filter by Mod Name' * )
442
+ request_mod=" $(
443
+ gum input --prompt ' Part or exact Name for a mod from the workshop: ' \
444
+ --char-limit 256 --value ' ts4ta:core'
445
+ ) "
446
+ filters+=(
447
+ " .value.mods[].name | test(\" ${request_mod,,} \" ; \" i\" )"
448
+ );;
414
449
esac
415
450
done 3< <(
416
451
printf ' %s\n' " ${available_filters[@]} " | \
417
452
gum choose --no-limit \
418
- --height=" $( menuHeight $(( ${# available_filters[@]} / 2 )) ) "
453
+ --height=" $( menuHeight 10 ) " # $((${#available_filters[@]}/2))
419
454
)
420
455
421
456
select=" select($( printf ' (%s) and ' " ${filters[@]} " ) ) |"
422
457
printf ' %s' " ${select// and[[:space:]])/ )} "
423
458
}
424
459
425
460
# Preview window for show server details
461
+ # shellcheck disable=SC2317
426
462
fzfPreview () {
427
463
local index=" $1 " server_data server_ip mods_count ping_limit=1 ping_count=1
428
464
@@ -445,7 +481,7 @@ fzfPreview() {
445
481
}
446
482
447
483
serverPing () {
448
- ping -q -c $ping_count -W $ping_limit " $1 " | awk -F ' /' \
484
+ ping -q -c " $ping_count " -W " $ping_limit " " $1 " | awk -F ' /' \
449
485
' END {print ($5==""?"❔":$5 " ms")}'
450
486
}
451
487
@@ -473,7 +509,10 @@ fzfPreview() {
473
509
Public: | \(if .shard=="public" then "🟢" else "🔴" end)
474
510
Modded: | \(if .mods|length > 0 then "🟢 [" +
475
511
(.mods|length|tostring) + "]" else "🔴" end)
476
- Version: | \(.version)"' <<< " $server_data" | gum format
512
+ Version: | \(.version)
513
+ Platform: | \(if .environment=="l" then
514
+ "🐧 [linux]" else "🪟 [windows]"
515
+ end)"' <<< " $server_data" | gum format
477
516
478
517
echo
479
518
server_ip=" $( jq -er ' .endpoint.ip' <<< " $server_data" ) "
@@ -556,7 +595,7 @@ getNotInstalledMods() {
556
595
} | gum format
557
596
558
597
# Helper for install mods without StemCMD
559
- if [ ! $DAYZ_STEAMCMD_ENABLED = true ] && [ " ${# missed_mods[@]} " -gt 0 ]; then
598
+ if [ ! " $DAYZ_STEAMCMD_ENABLED " = true ] && [ " ${# missed_mods[@]} " -gt 0 ]; then
560
599
if command -v xdg-open & > /dev/null && gum confirm --prompt.align=center \
561
600
' Open all Steam Workshop links for missing mods for you?'
562
601
then
@@ -861,7 +900,6 @@ connectFromArg() {
861
900
)
862
901
addHistoryServer " $ip " " $query_port " " $name "
863
902
runDayZ " ${exec_args[@]} "
864
- exit 0
865
903
}
866
904
867
905
# Connect by IP:port
@@ -1282,7 +1320,7 @@ configMenu() {
1282
1320
# Base options #1
1283
1321
local config_menu_options=(' Game launch options' ' Change Steam root dir' )
1284
1322
# Options for SteamCMD
1285
- if [ $DAYZ_STEAMCMD_ENABLED = true ]; then
1323
+ if [ " $DAYZ_STEAMCMD_ENABLED " = true ]; then
1286
1324
config_menu_options+=(' Change Steam login' ' Disable SteamCMD' )
1287
1325
else
1288
1326
config_menu_options+=(' Set Steam login' )
@@ -1296,7 +1334,7 @@ configMenu() {
1296
1334
' Remove manged mods'
1297
1335
' Remove all mod links'
1298
1336
)
1299
- [ $DAYZ_STEAMCMD_ENABLED = true ] &&
1337
+ [ " $DAYZ_STEAMCMD_ENABLED " = true ] &&
1300
1338
config_menu_options+=(' Force update game and all mods' )
1301
1339
fi
1302
1340
# Base options #3
@@ -1466,7 +1504,7 @@ export dayz_path="$steam_root/common/DayZ"
1466
1504
export dayz_workshop_path=" $steam_root /workshop/content/$DAYZ_GAME_ID "
1467
1505
1468
1506
# Get Steam profile
1469
- if [ $DAYZ_STEAMCMD_ENABLED = true ]; then
1507
+ if [ " $DAYZ_STEAMCMD_ENABLED " = true ]; then
1470
1508
steam_login=" $( jq -er ' .steam_login // ""' " $DAYZ_PROFILE " 2> /dev/null) "
1471
1509
if [ -z " $steam_login " ]; then
1472
1510
setProfileSteamLogin
@@ -1552,11 +1590,11 @@ while read -r option; do
1552
1590
fi ;;
1553
1591
' Direct Connect' )
1554
1592
server_data=" $( directConnect) " ;;
1555
- ' Launch Game' ) runDayZ " ${dayz_launch_options[@]} " ; exit 0; ;
1556
- ' Play Offline' ) runDayZOffline " ${dayz_launch_options[@]} " ; exit 0; ;
1593
+ ' Launch Game' ) runDayZ " ${dayz_launch_options[@]} " ;;
1594
+ ' Play Offline' ) runDayZOffline " ${dayz_launch_options[@]} " ;;
1557
1595
' DayZ News' ) getDayzNews " $(( $(tput lines)/ 2 - 3 )) " | less -R; execSelf;;
1558
1596
' Config' ) configMenu;;
1559
- * ) fail " Unknown option $option " ; exit 0; ;
1597
+ * ) fail " Unknown option $option " ;;
1560
1598
esac
1561
1599
done < <(
1562
1600
printf ' %s\n' " ${main_menu_options[@]} " | \
@@ -1623,8 +1661,7 @@ while read -r option; do
1623
1661
argsFromServerData " $server_data " " ${dayz_launch_options[@]} "
1624
1662
)
1625
1663
addHistoryServer " $server_ip " " $server_query_port " " $server_name "
1626
- runDayZ " ${exec_args[@]} "
1627
- exit 0;;
1664
+ runDayZ " ${exec_args[@]} " ;;
1628
1665
* ) fail " Unknown option $1 " ;;
1629
1666
esac
1630
1667
done < <( printf ' %s\n' " ${choose_play_options[@]} " | gum choose --no-limit)
@@ -1635,6 +1672,3 @@ exit 0
1635
1672
# flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper com.valvesoftware.Steam "${@}"
1636
1673
1637
1674
# TODO add some args for usage
1638
-
1639
- # TODO
1640
- # https://github.com/CypherMediaGIT/DayZCommunityOfflineMode-DeerIsle-Edition
0 commit comments