From 03d44e510df45a6fa3a5670cb95b34a0c4deb9ba Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 27 Oct 2023 20:20:06 +0100 Subject: [PATCH] refactor: remove unnecessary code duplication in info_game.sh The commit removes duplicated code for retrieving server information from the game configuration file. Specifically, it removes redundant lines related to rconpassword, rconport, and serverpassword. This improves code readability and maintainability. --- lgsm/modules/info_game.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index f6d650fc9..242393c53 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1138,25 +1138,18 @@ fn_info_game_col() { # Filetype: cfg fn_info_game_cs2() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_valve_keyvalues "rconpassword" "rcon_password" fn_info_game_valve_keyvalues "servername" "hostname" - fn_info_game_valve_keyvalues "serverpassword" "sv_password" fi # Steamport can be between 26901-26910 and is normally automatically set. # Some servers might support -steamport parameter to set if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" fi - clientport="${clientport:-"0"}" defaultmap="${defaultmap:-"NOT SET"}" maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" queryport="${port:-"0"}" - rconpassword="${rconpassword:-"NOT SET"}" - rconport="${port:-"0"}" servername="${servername:-"NOT SET"}" - serverpassword="${serverpassword:-"NOT SET"}" - # steamport="${steamport:-"0"}" Steamport is optional so we dont want it to show as not set. } # Config Type: ini