feat: add the --name parameter

This commit is contained in:
bastimeyer 2021-12-06 05:23:51 +01:00
parent cc9bc79c4d
commit d72885134f
2 changed files with 16 additions and 0 deletions

View file

@ -28,6 +28,11 @@ Command line options:
Launch DayZ after resolving and setting up mods
instead of printing the game's -mod command line argument.
-n <name>
--name <name>
Set the profile name when launching the game via --launch.
Some community servers require a profile name when trying to connect.
-s <address[:port]>
--server <address[:port]>
Retrieve a server's mod list and add it to the remaining input.

View file

@ -24,6 +24,7 @@ DEBUG=0
LAUNCH=0
SERVER=""
PORT="27016"
NAME=""
INPUT=()
MODS=()
@ -57,6 +58,11 @@ Command line options:
Launch DayZ after resolving and setting up mods
instead of printing the game's -mod command line argument.
-n <name>
--name <name>
Set the profile name when launching the game via --launch.
Some community servers require a profile name when trying to connect.
-s <address[:port]>
--server <address[:port]>
Retrieve a server's mod list and add it to the remaining input.
@ -101,6 +107,10 @@ while (( "$#" )); do
PORT="${2}"
shift
;;
-n|--name)
NAME="${2}"
shift
;;
*)
INPUT+=("${1}")
;;
@ -199,6 +209,7 @@ main() {
local cmdline=()
[[ -n "${mods}" ]] && cmdline+=("-mod=${mods}")
[[ -n "${SERVER}" ]] && cmdline+=("-connect=${SERVER}" -nolauncher -world=empty)
[[ -n "${NAME}" ]] && cmdline+=("-name=${NAME}")
( set -x; steam -applaunch "${DAYZ_ID}" "${cmdline[@]}"; )
elif [[ -n "${mods}" ]]; then
msg "Add this to your game's launch options, including the quotes:"