Daniel Gibbs 10 лет назад
Родитель
Сommit
8d3cc1112d

+ 1 - 8
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}

+ 1 - 10
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

+ 1 - 4
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"
 }
 

+ 10 - 0
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
 

+ 21 - 0
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

+ 2 - 2
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

+ 60 - 0
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

+ 1 - 4
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(){