Browse Source

Added pc info

also shuffled a couple of functions
pull/1355/head^2
Daniel Gibbs 8 years ago
parent
commit
2c8e4a3aaa
  1. 121
      lgsm/functions/info_config.sh

121
lgsm/functions/info_config.sh

@ -49,6 +49,29 @@ fn_info_config_ark(){
fi
}
fn_info_config_ballistic_overkill(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
serverpassword="${unavailable}"
port="${zero}"
queryport="${zero}"
maxplayers="${unavailable}"
else
servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]')
queryport=$((port + 1))
maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]')
# Not Set
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
port=${port:-"0"}
queryport=${queryport:-"0"}
maxplayers=${maxplayers:-"NOT SET"}
fi
}
fn_info_config_bf1942(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
@ -226,6 +249,27 @@ fn_info_config_minecraft(){
fi
}
fn_info_config_projectcars(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
serverpassword="${unavailable}"
maxplayers="${zero}"
port="${zero}"
queryport="${zero}"
else
servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
# Not Set
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
maxplayers=${maxplayers:-"NOT SET"}
port=${port:-"NOT SET"}
queryport=${queryport:-"NOT SET"}
}
fn_info_config_projectzomboid(){
if [ ! -f "${servercfgfullpath}" ]; then
@ -315,33 +359,6 @@ fn_info_config_quakelive(){
fi
}
fn_info_config_wolfensteinenemyterritory(){
if [ ! -f "${servercfgfullpath}" ]; then
rconpassword="${unavailable}"
servername="${unavailable}"
serverpassword="${unavailable}"
maxplayers="${zero}"
port="${zero}"
else
port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
ipsetinconfig=1
ipinconfigvar="set net_ip"
# Not Set
rconpassword=${rconpassword:-"NOT SET"}
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
port=${port:-"27960"}
fi
}
fn_info_config_realvirtuality(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
@ -568,29 +585,6 @@ fn_info_config_unreal(){
fi
}
fn_info_config_ballistic_overkill(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
serverpassword="${unavailable}"
port="${zero}"
queryport="${zero}"
maxplayers="${unavailable}"
else
servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]')
queryport=$((port + 1))
maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]')
# Not Set
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
port=${port:-"0"}
queryport=${queryport:-"0"}
maxplayers=${maxplayers:-"NOT SET"}
fi
}
fn_info_config_sdtd(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
@ -677,6 +671,33 @@ fn_info_config_mta(){
fi
}
fn_info_config_wolfensteinenemyterritory(){
if [ ! -f "${servercfgfullpath}" ]; then
rconpassword="${unavailable}"
servername="${unavailable}"
serverpassword="${unavailable}"
maxplayers="${zero}"
port="${zero}"
else
port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
ipsetinconfig=1
ipinconfigvar="set net_ip"
# Not Set
rconpassword=${rconpassword:-"NOT SET"}
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
port=${port:-"27960"}
fi
}
# Just Cause 2
if [ "${engine}" == "avalanche" ]; then
fn_info_config_avalanche

Loading…
Cancel
Save