|
@@ -6,6 +6,45 @@
|
|
|
|
|
|
|
|
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|
|
|
|
|
|
|
|
|
+# function to simplify the steamclient.so fix
|
|
|
|
|
+# example
|
|
|
|
|
+# fn_fix_steamclient_so 32|64 (bit) "${serverfiles}/linux32/"
|
|
|
|
|
+fn_fix_steamclient_so(){
|
|
|
|
|
+ # $1 type of fix 32 or 64 as possible values
|
|
|
|
|
+ # $2 as destination where the lib will be copied to
|
|
|
|
|
+ if [ "$1" == "32" ]; then
|
|
|
|
|
+ # steamclient.so x86 fix.
|
|
|
|
|
+ if [ ! -f "${2}/steamclient.so" ]; then
|
|
|
|
|
+ fixname="steamclient.so x86"
|
|
|
|
|
+ fn_fix_msg_start
|
|
|
|
|
+ if [ ! -d "${2}" ]; then
|
|
|
|
|
+ mkdir -p "${2}"
|
|
|
|
|
+ fi
|
|
|
|
|
+ if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
|
|
|
|
|
+ cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${2}/steamclient.so"
|
|
|
|
|
+ elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
|
|
|
|
|
+ cp "${steamcmddir}/linux32/steamclient.so" "${2}/steamclient.so"
|
|
|
|
|
+ fi
|
|
|
|
|
+ fn_fix_msg_end
|
|
|
|
|
+ fi
|
|
|
|
|
+ elif [ "$1" == "64" ]; then
|
|
|
|
|
+ # steamclient.so x86_64 fix.
|
|
|
|
|
+ if [ ! -f "${2}/steamclient.so" ]; then
|
|
|
|
|
+ fixname="steamclient.so x86_64"
|
|
|
|
|
+ fn_fix_msg_start
|
|
|
|
|
+ if [ ! -d "${2}" ]; then
|
|
|
|
|
+ mkdir -p "${2}"
|
|
|
|
|
+ fi
|
|
|
|
|
+ if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then
|
|
|
|
|
+ cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${2}/steamclient.so"
|
|
|
|
|
+ elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then
|
|
|
|
|
+ cp "${steamcmddir}/linux64/steamclient.so" "${2}/steamclient.so"
|
|
|
|
|
+ fi
|
|
|
|
|
+ fn_fix_msg_end
|
|
|
|
|
+ fi
|
|
|
|
|
+ fi
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so.
|
|
# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so.
|
|
|
if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then
|
|
if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then
|
|
|
fixname="steamclient.so sdk64"
|
|
fixname="steamclient.so sdk64"
|
|
@@ -31,3 +70,24 @@ if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then
|
|
|
fi
|
|
fi
|
|
|
fn_fix_msg_end
|
|
fn_fix_msg_end
|
|
|
fi
|
|
fi
|
|
|
|
|
+
|
|
|
|
|
+# steamclient.so fixes
|
|
|
|
|
+if [ "${shortname}" == "bo" ]; then
|
|
|
|
|
+ fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86"
|
|
|
|
|
+ fn_fix_steamclient_so "64" "${serverfiles}/BODS_Data/Plugins/x86_64"
|
|
|
|
|
+elif [ "${shortname}" == "cmw" ]; then
|
|
|
|
|
+ fn_fix_steamclient_so "32" "${executabledir}/lib"
|
|
|
|
|
+elif [ "${shortname}" == "cs" ]; then
|
|
|
|
|
+ fn_fix_steamclient_so "32" "${serverfiles}"
|
|
|
|
|
+elif [ "${shortname}" == "pz" ]; then
|
|
|
|
|
+ fn_fix_steamclient_so "32" "${serverfiles}/linux32"
|
|
|
|
|
+ fn_fix_steamclient_so "64" "${serverfiles}/linux64"
|
|
|
|
|
+elif [ "${shortname}" == "ss3" ]; then
|
|
|
|
|
+ fn_fix_steamclient_so "32" "${serverfiles}/Bin"
|
|
|
|
|
+elif [ "${shortname}" == "tu" ];then
|
|
|
|
|
+ fn_fix_steamclient_so "64" "${executabledir}"
|
|
|
|
|
+elif [ "${shortname}" == "unt" ]; then
|
|
|
|
|
+ fn_fix_steamclient_so "64" "${serverfiles}"
|
|
|
|
|
+elif [ "${shortname}" == "wurm" ]; then
|
|
|
|
|
+ fn_fix_steamclient_so "64" "${serverfiles}/nativelibs"
|
|
|
|
|
+fi
|