Skip to content

Commit

Permalink
feat: add installation and information for SteamCMD
Browse files Browse the repository at this point in the history
- Added code to install SteamCMD if it is missing or the steamcmd directory is missing.
- Modified the check_steamcmd function to print a warning message if SteamCMD is not installed.
- Modified the info_game_dst function to retrieve additional information from server and cluster configuration files.
- Updated the installation script to display a bold header before installing SteamCMD.
  • Loading branch information
dgibbs64 committed Sep 29, 2023
1 parent 1444d13 commit df02b1f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion lgsm/modules/core_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ fn_check_steamcmd() {
# Only install if steamcmd package is missing or steamcmd dir is missing.
if [ ! -f "${steamcmddir}/steamcmd.sh" ] && [ -z "$(command -v steamcmd 2> /dev/null)" ]; then
if [ "${commandname}" == "INSTALL" ]; then
echo -e "install SteamCMD"
fn_install_steamcmd
else
fn_print_warn_nl "SteamCMD is not installed"
fn_script_log_warn "SteamCMD is not installed"
fn_install_steamcmd
fi
elif [ "${commandname}" == "INSTALL" ]; then
echo -en "SteamCMD is already installed"
echo -en "install SteamCMD"
fn_print_skip_eol_nl
fi
}
Expand Down
14 changes: 8 additions & 6 deletions lgsm/modules/info_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -434,18 +434,20 @@ fn_info_game_dodr() {
# Filetype: ini
fn_info_game_dst() {
if [ -f "${servercfgfullpath}" ]; then
fn_info_game_ini "port" "server_port"
fn_info_game_ini "steamauthport" "authentication_port"
fn_info_game_ini "steamport" "master_server_port"
fn_info_game_ini "port" "server_port" "${servercfgfullpath}"
fn_info_game_ini "shard" "name" "${servercfgfullpath}"
fn_info_game_ini "steamauthport" "authentication_port" "${servercfgfullpath}"
fn_info_game_ini "steamport" "master_server_port" "${servercfgfullpath}"
fi
if [ -f "${clustercfgfullpath}" ]; then
fn_info_game_ini "configip" "bind_ip" "${clustercfgfullpath}"
fn_info_game_ini "gamemode" "game_mode" "${clustercfgfullpath}"
fn_info_game_ini "masterport" "master_port" "${clustercfgfullpath}"
fn_info_game_ini "maxplayers" "max_players" "${clustercfgfullpath}"
fn_info_game_ini "servername" "cluster_name" "${clustercfgfullpath}"
fn_info_game_ini "serverpassword" "cluster_password" "${clustercfgfullpath}"
fn_info_game_ini "tickrate" "tick_rate" "${clustercfgfullpath}"
fn_info_game_ini "masterport" "master_port" "${clustercfgfullpath}"
fn_info_game_ini "gamemode" "game_mode" "${clustercfgfullpath}"
fn_info_game_ini "configip" "bind_ip" "${clustercfgfullpath}"

fi

cave="${cave:-"NOT SET"}"
Expand Down
4 changes: 2 additions & 2 deletions lgsm/modules/install_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

echo -e ""
echo -e "${lightyellow}Installing SteamCMD${default}"
echo -e "================================="
echo -e "${bold}${lightyellow}Installing SteamCMD${default}"
echo -e "${bold}=================================${default}"
fn_sleep_time
check_steamcmd.sh

0 comments on commit df02b1f

Please sign in to comment.