From 8d3cc1112d84022243acd39335aa805bf39504cd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Dec 2015 00:36:54 +0000 Subject: [PATCH] intergrating fix.sh --- functions/command_debug.sh | 9 +----- functions/command_start.sh | 11 +------ functions/command_validate.sh | 5 +-- functions/core_functions.sh | 10 ++++++ functions/fix.sh | 21 ++++++++++++ functions/fix_csgo.sh | 4 +-- functions/fix_steamcmd.sh | 60 +++++++++++++++++++++++++++++++++++ functions/update_dl.sh | 5 +-- 8 files changed, 97 insertions(+), 28 deletions(-) create mode 100644 functions/fix.sh create mode 100644 functions/fix_steamcmd.sh diff --git a/functions/command_debug.sh b/functions/command_debug.sh index bec1f7ade..91f91dd66 100644 --- a/functions/command_debug.sh +++ b/functions/command_debug.sh @@ -52,15 +52,8 @@ fn_scriptlog "Started debug" sleep 1 echo -en "\n" cd "${executabledir}" +fix.sh if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then - if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - startfix=1 - fix_csgo.sh - elif [ "${gamename}" == "Insurgency" ]; then - fix_ins.sh - elif [ "${gamename}" == "ARMA 3" ]; then - fix_arma3.sh - fi ${executable} ${parms} -debug else ${executable} ${parms} diff --git a/functions/command_start.sh b/functions/command_start.sh index 2a4c9b74c..a79302698 100644 --- a/functions/command_start.sh +++ b/functions/command_start.sh @@ -73,16 +73,7 @@ echo -en "\n" fn_start_tmux(){ check.sh - -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - startfix=1 - fix_csgo.sh -elif [ "${gamename}" == "Insurgency" ]; then - fix_ins.sh -elif [ "${gamename}" == "ARMA 3" ]; then - fix_arma3.sh -fi - +fix.sh info_config.sh fn_parms logs.sh diff --git a/functions/command_validate.sh b/functions/command_validate.sh index 1d3774276..b6dc36819 100644 --- a/functions/command_validate.sh +++ b/functions/command_validate.sh @@ -34,10 +34,7 @@ else ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" fi -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - echo -e '\n' - fix_csgo.sh -fi +fix.sh fn_scriptlog "Checking complete" } diff --git a/functions/core_functions.sh b/functions/core_functions.sh index 2aa1648c0..41e86824d 100644 --- a/functions/core_functions.sh +++ b/functions/core_functions.sh @@ -165,6 +165,11 @@ fn_runfunction # Fix +fix.sh(){ +functionfile="${FUNCNAME}" +fn_runfunction +} + fix_arma3.sh(){ functionfile="${FUNCNAME}" fn_runfunction @@ -180,6 +185,11 @@ functionfile="${FUNCNAME}" fn_runfunction } +fix_steamcmd.sh(){ +functionfile="${FUNCNAME}" +fn_runfunction +} + # Info diff --git a/functions/fix.sh b/functions/fix.sh new file mode 100644 index 000000000..4659831e6 --- /dev/null +++ b/functions/fix.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# LGSM fix.sh function +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com +lgsm_version="291215" + +# Description: Overall function for managing fixes. +# Runs functions that will fix an issue. + +if [ ! -z "${appid}" ]; then + fix_steamcmd.sh +fi + +if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then + startfix=1 + fix_csgo.sh +elif [ "${gamename}" == "Insurgency" ]; then + fix_ins.sh +elif [ "${gamename}" == "ARMA 3" ]; then + fix_arma3.sh +fi \ No newline at end of file diff --git a/functions/fix_csgo.sh b/functions/fix_csgo.sh index 488149b0f..c6243d5c6 100644 --- a/functions/fix_csgo.sh +++ b/functions/fix_csgo.sh @@ -19,7 +19,7 @@ if [ ! -f "${filesdir}/steam_appid.txt" ]; then fi } -fn_csgofixes(){ +fn_install_fix_csgo(){ # Fixes the following error: # Error parsing BotProfile.db - unknown attribute 'Rank". if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then @@ -84,5 +84,5 @@ fi if [ ! -z "${startfix}" ]; then fn_csgoappfix else - fn_csgofixes + fn_install_fix_csgo fi \ No newline at end of file diff --git a/functions/fix_steamcmd.sh b/functions/fix_steamcmd.sh new file mode 100644 index 000000000..e373e03ab --- /dev/null +++ b/functions/fix_steamcmd.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# LGSM fix_steamcmd.sh function +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com +lgsm_version="301215" + +# Description: fixes various issues related to steamCMD + +fn_fix_steamcmd_msg_start(){ + fn_printdots "Applying steamclient.so fix: ${gamename}" + sleep 2 + fn_printinfo "Applying steamclient.so fix: ${gamename}" +} + +fn_fix_steamcmd_msg_end(){ + if [ $? -ne 0 ]; then + fn_printfail "Applying steamclient.so fix: ${gamename}" + else + fn_printok "Applying steamclient.so fix: ${gamename}" + fi +} + + +# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then + fn_fix_steamcmd_msg_start + mkdir -pv "${HOME}/.steam/sdk32" + cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" + fn_fix_steamcmd_msg_end +fi + +if [ "${gamename}" == "Garry's Mod" ]; then + # Fixes: .steam/sdk32/libsteam.so: cannot open shared object file: No such file or directory + if [ ! -f "${HOME}/.steam/sdk32/libsteam.so" ]; then + fn_fix_steamcmd_msg_start + mkdir -pv "${HOME}/.steam/sdk32" + cp -v "${filesdir}/bin/libsteam.so" "${HOME}/.steam/sdk32/libsteam.so" + fn_fix_steamcmd_msg_end + fi +elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then + # Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory + if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then + fn_fix_steamcmd_msg_start + mkdir -pv "${HOME}/.steam/bin32" + cp -v "${filesdir}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" + fn_fix_steamcmd_msg_end + fi +elif [ "${gamename}" == "Hurtworld" ]; then + # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. + if [ ! -f "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then + fn_fix_steamcmd_msg_start + cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so" + fn_fix_steamcmd_msg_end + fi + if [ ! -f "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then + fn_fix_steamcmd_msg_start + cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so" + fn_fix_steamcmd_msg_end + fi +fi diff --git a/functions/update_dl.sh b/functions/update_dl.sh index 21fa13154..09bd3ebe9 100644 --- a/functions/update_dl.sh +++ b/functions/update_dl.sh @@ -24,10 +24,7 @@ else ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit|tee -a "${scriptlog}" fi -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - echo -e '\n' - fix_csgo.sh -fi +fix.sh } fn_teamspeak3_dl(){