fn_csgofix 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/bash
  2. # LGSM fn_csgofix function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. # Version: 210115
  6. # Description: Resolves various issues with csgo.
  7. # Fixed server not always creating steam_appid.txt file.
  8. fn_csgoappfix(){
  9. if [ ! -f "${filesdir}/steam_appid.txt" ]; then
  10. fn_printdots "Applying 730 steam_appid.txt Fix."
  11. sleep 1
  12. fn_printinfo "Applying 730 steam_appid.txt Fix."
  13. fn_scriptlog "Applying 730 steam_appid.txt Fix"
  14. sleep 1
  15. echo -en "\n"
  16. echo -n "730" >> "${filesdir}/steam_appid.txt"
  17. fi
  18. }
  19. fn_csgofixes(){
  20. # Fixes the following error:
  21. # Error parsing BotProfile.db - unknown attribute 'Rank".
  22. if ! grep -q "//Rank" "${systemdir}/botprofile.db" ; then
  23. echo "botprofile.db fix removes the following error from appearing on the console:"
  24. echo " Error parsing BotProfile.db - unknown attribute 'Rank"
  25. sleep 1
  26. fn_printdots "Applying botprofile.db fix."
  27. sleep 1
  28. fn_printinfo "Applying botprofile.db fix."
  29. sleep 1
  30. sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db"
  31. echo -en "\n"
  32. echo ""
  33. fi
  34. # Fixes errors simular to the following:
  35. # Unknown command "cl_bobamt_vert".
  36. if ! grep -q "//exec default" "${servercfgdir}/valve.rc" || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc"; then
  37. echo "valve.rc fix removes the following error from appearing on the console:"
  38. echo " Unknown command \"cl_bobamt_vert\""
  39. sleep 1
  40. fn_printdots "Applying valve.rc fix."
  41. sleep 1
  42. fn_printinfo "Applying valve.rc fix."
  43. sleep 1
  44. sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc"
  45. sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc"
  46. echo -en "\n"
  47. echo ""
  48. fi
  49. # Fixes errors simular to the following:
  50. # http://forums.steampowered.com/forums/showthread.php?t=3170366.
  51. if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subscribed_file_ids.txt" ]||[ -f "${systemdir}/ugc_collection_cache.txt" ]; then
  52. echo "workshopmapfix fixes the following error:"
  53. echo " http://forums.steampowered.com/forums/showthread.php?t=3170366"
  54. sleep 1
  55. fn_printdots "Applying workshopmap fix."
  56. sleep 1
  57. fn_printinfo "Applying workshopmap fix."
  58. sleep 1
  59. rm -f "${systemdir}/subscribed_collection_ids.txt"
  60. rm -f "${systemdir}/subscribed_file_ids.txt"
  61. rm -f "${systemdir}/ugc_collection_cache.txt"
  62. echo -en "\n"
  63. echo ""
  64. fi
  65. }
  66. if [ ! -z "${startfix}" ]; then
  67. fn_csgoappfix
  68. else
  69. fn_csgofixes
  70. fi