Skip to content

Commit

Permalink
game info
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Oct 27, 2023
1 parent e208d91 commit abff04d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lgsm/modules/info_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,33 @@ fn_info_game_col() {
steamport="${steamport:-"0"}"
}

# Config Type: Valve KeyValues
# Comment: //
# Example: hostname "SERVERNAME"
# 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
# Parameters: true
# Comment: ; or #
Expand Down
10 changes: 10 additions & 0 deletions lgsm/modules/info_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,14 @@ fn_info_message_col() {
} | column -s $'\t' -t
}

fn_info_message_cs2() {
{
fn_port "header"
fn_port "Game" port udp
fn_port "Query" queryport tcp
} | column -s $'\t' -t
}

fn_info_message_csgo() {
{
fn_port "header"
Expand Down Expand Up @@ -1691,6 +1699,8 @@ fn_info_message_select_engine() {
fn_info_messages_cd
elif [ "${shortname}" == "ck" ]; then
fn_info_messages_ck
elif [ "${shortname}" == "cs2" ]; then
fn_info_messages_cs2
elif [ "${shortname}" == "csgo" ]; then
fn_info_message_csgo
elif [ "${shortname}" == "cmw" ]; then
Expand Down

0 comments on commit abff04d

Please sign in to comment.