|
|
@@ -2,87 +2,60 @@
|
|
|
# LGSM fix_csgo.sh function
|
|
|
# Author: Daniel Gibbs
|
|
|
# Website: http://gameservermanagers.com
|
|
|
-lgsm_version="271215"
|
|
|
+lgsm_version="301215"
|
|
|
|
|
|
# Description: Resolves various issues with csgo.
|
|
|
|
|
|
-# Fixed server not always creating steam_appid.txt file.
|
|
|
-fn_csgoappfix(){
|
|
|
-if [ ! -f "${filesdir}/steam_appid.txt" ]; then
|
|
|
- fn_printdots "Applying 730 steam_appid.txt Fix."
|
|
|
+fn_msg_start(){
|
|
|
+ fn_printdots "Applying ${fixname} fix: ${gamename}"
|
|
|
sleep 1
|
|
|
- fn_printinfo "Applying 730 steam_appid.txt Fix."
|
|
|
- fn_scriptlog "Applying 730 steam_appid.txt Fix"
|
|
|
+ fn_printinfo "Applying ${fixname} fix: ${gamename}"
|
|
|
+ fn_scriptlog "Applying ${fixname} fix: ${gamename}"
|
|
|
sleep 1
|
|
|
- echo -en "\n"
|
|
|
+}
|
|
|
+
|
|
|
+fn_msg_end(){
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
+ fn_printfailnl "Applying ${fixname} fix: ${gamename}"
|
|
|
+ fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}"
|
|
|
+ else
|
|
|
+ fn_printoknl "Applying ${fixname} fix: ${gamename}"
|
|
|
+ fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}"
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
+# Fixes: server not always creating steam_appid.txt file.
|
|
|
+if [ ! -f "${filesdir}/steam_appid.txt" ]; then
|
|
|
+ local fixname="730 steam_appid.txt"
|
|
|
+ fn_msg_start
|
|
|
echo -n "730" >> "${filesdir}/steam_appid.txt"
|
|
|
+ fn_msg_end
|
|
|
fi
|
|
|
-}
|
|
|
|
|
|
-fn_csgofixes(){
|
|
|
-# Fixes the following error:
|
|
|
-# Error parsing BotProfile.db - unknown attribute 'Rank".
|
|
|
+# Fixes: Error parsing BotProfile.db - unknown attribute 'Rank'".
|
|
|
if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then
|
|
|
- echo "Applying botprofile.db fix."
|
|
|
- sleep 1
|
|
|
- echo ""
|
|
|
- echo "botprofile.db fix removes the following error from appearing on the console:"
|
|
|
- echo " Error parsing BotProfile.db - unknown attribute 'Rank"
|
|
|
- sleep 1
|
|
|
+ local fixname="botprofile.db"
|
|
|
+ fn_msg_start
|
|
|
sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1
|
|
|
- if [ $? -ne 0 ]; then
|
|
|
- fn_printfailure "Applying botprofile.db fix."
|
|
|
- else
|
|
|
- fn_printcomplete "Applying botprofile.db fix."
|
|
|
- fi
|
|
|
- echo -en "\n"
|
|
|
- echo ""
|
|
|
+ fn_msg_end
|
|
|
fi
|
|
|
|
|
|
-# Fixes errors simular to the following:
|
|
|
-# Unknown command "cl_bobamt_vert".
|
|
|
+# Fixes: Unknown command "cl_bobamt_vert".
|
|
|
if ! grep -q "//exec default" "${servercfgdir}/valve.rc" > /dev/null 2>&1 || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc" > /dev/null 2>&1; then
|
|
|
- echo "Applying valve.rc fix."
|
|
|
- sleep 1
|
|
|
- echo ""
|
|
|
- echo "valve.rc fix removes the following error from appearing on the console:"
|
|
|
- echo " Unknown command \"cl_bobamt_vert\""
|
|
|
- sleep 1
|
|
|
+ local fixname="valve.rc"
|
|
|
+ fn_msg_start
|
|
|
sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
|
|
|
sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
|
|
|
- if [ $? -ne 0 ]; then
|
|
|
- fn_printfailure "Applying valve.rc fix."
|
|
|
- else
|
|
|
- fn_printcomplete "Applying valve.rc fix."
|
|
|
- fi
|
|
|
- echo -en "\n"
|
|
|
- echo ""
|
|
|
+ fn_msg_end
|
|
|
fi
|
|
|
|
|
|
-# Fixes errors simular to the following:
|
|
|
+# Fixes: workshop map issue.
|
|
|
# http://forums.steampowered.com/forums/showthread.php?t=3170366.
|
|
|
if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subscribed_file_ids.txt" ]||[ -f "${systemdir}/ugc_collection_cache.txt" ]; then
|
|
|
- echo "workshopmapfix fixes the following error:"
|
|
|
- echo " http://forums.steampowered.com/forums/showthread.php?t=3170366"
|
|
|
- sleep 1
|
|
|
- echo ""
|
|
|
- echo "Applying workshopmap fix."
|
|
|
- sleep 1
|
|
|
+ local fixname="workshop map"
|
|
|
+ fn_msg_start
|
|
|
rm -f "${systemdir}/subscribed_collection_ids.txt"
|
|
|
rm -f "${systemdir}/subscribed_file_ids.txt"
|
|
|
rm -f "${systemdir}/ugc_collection_cache.txt"
|
|
|
- if [ $? -ne 0 ]; then
|
|
|
- fn_printfailure "Applying workshopmap fix."
|
|
|
- else
|
|
|
- fn_printcomplete "Applying workshopmap fix."
|
|
|
- fi
|
|
|
- echo -en "\n"
|
|
|
- echo ""
|
|
|
-fi
|
|
|
-}
|
|
|
-
|
|
|
-if [ ! -z "${startfix}" ]; then
|
|
|
- fn_csgoappfix
|
|
|
-else
|
|
|
- fn_csgofixes
|
|
|
+ fn_msg_end
|
|
|
fi
|