From fe5e45d5d0f831722a7eeadf54f795ae854ab836 Mon Sep 17 00:00:00 2001 From: H3o66 Date: Sun, 13 Sep 2020 18:34:43 +0200 Subject: [PATCH] fix(pz): fix steamclient missing --- lgsm/functions/core_functions.sh | 5 +++++ lgsm/functions/fix.sh | 2 ++ lgsm/functions/fix_pz.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 lgsm/functions/fix_pz.sh diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 2057caf94..8a035ab76 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -380,6 +380,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +fix_pz.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + fix_ro.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 74d6fb00b..0c1c9a78f 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -56,6 +56,8 @@ if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then fix_nmrih.sh elif [ "${shortname}" == "onset" ]; then fix_onset.sh + elif [ "${shortname}" == "pz" ]; then + fix_pz.sh elif [ "${shortname}" == "rust" ]; then fix_rust.sh elif [ "${shortname}" == "rw" ]; then diff --git a/lgsm/functions/fix_pz.sh b/lgsm/functions/fix_pz.sh new file mode 100644 index 000000000..0d2e75941 --- /dev/null +++ b/lgsm/functions/fix_pz.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LinuxGSM fix_pz.sh function +# Author: Christian Birk +# Website: https://linuxgsm.com +# Description: Resolves various issues with Project Zomboid. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "${shortname}" == "pz" ]; then + # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. + if [ ! -f "${serverfiles}/linux32/steamclient.so" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/linux32/steamclient.so" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/linux32/steamclient.so" >> "${lgsmlog}" + fi + fn_fix_msg_end + fi + if [ ! -f "${serverfiles}/linux64/steamclient.so" ]; then + fixname="steamclient.so x86_64" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/linux64/steamclient.so" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/linux64/steamclient.so" >> "${lgsmlog}" + fi + fn_fix_msg_end + fi +fi