diff --git a/README.md b/README.md index 0b5b037..4526385 100644 --- a/README.md +++ b/README.md @@ -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 + Set the profile name when launching the game via --launch. + Some community servers require a profile name when trying to connect. + -s --server Retrieve a server's mod list and add it to the remaining input. diff --git a/dayz-mods.sh b/dayz-mods.sh index 59cc14e..72d60e1 100755 --- a/dayz-mods.sh +++ b/dayz-mods.sh @@ -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 + Set the profile name when launching the game via --launch. + Some community servers require a profile name when trying to connect. + -s --server 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:"