|
|
@@ -14,7 +14,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|
|
# grep -v "foo" filter out lines that contain foo
|
|
|
# cut -f1 -d "/" remove everything after /
|
|
|
|
|
|
-fn_info_config_avalanche(){
|
|
|
+fn_info_config_justcause2(){
|
|
|
if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
servername="${unavailable}"
|
|
|
serverpassword="${unavailable}"
|
|
|
@@ -22,6 +22,7 @@ fn_info_config_avalanche(){
|
|
|
port="${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]*$//')
|
|
|
+ serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
|
|
|
serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//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 "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
|
|
|
@@ -38,6 +39,42 @@ fn_info_config_avalanche(){
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
+fn_info_config_justcause3(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ serverdescription="${unavailable}"
|
|
|
+ serverpassword="${unavailable}"
|
|
|
+ maxplayers="${zero}"
|
|
|
+ port="${zero}"
|
|
|
+ queryPort="${zero}"
|
|
|
+ steamport="${zero}"
|
|
|
+ tickrate="${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]*$//')
|
|
|
+ serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//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}" | tr -cd '[:digit:]')
|
|
|
+ port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
+ queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
+ steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
+ tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
+
|
|
|
+ ip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
|
|
|
+ ipsetinconfig=1
|
|
|
+ ipinconfigvar="host"
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ serverdescription=${serverdescription:-"NOT SET"}
|
|
|
+ serverpassword=${serverpassword:-"NOT SET"}
|
|
|
+ maxplayers=${maxplayers=:-"0"}
|
|
|
+ port=${port=:-"0"}
|
|
|
+ queryport=${queryport=:-"0"}
|
|
|
+ steamport=${steamport=:-"0"}
|
|
|
+ tickrate=${tickrate=:-"0"}
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
fn_info_config_ark(){
|
|
|
if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
servername="${unavailable}"
|
|
|
@@ -475,7 +512,7 @@ fn_info_config_starbound(){
|
|
|
# Not Set
|
|
|
servername=${servername:-"NOT SET"}
|
|
|
queryenabled=${queryenabled:-"NOT SET"}
|
|
|
- rconenabled==${rconenabled:-"NOT SET"}
|
|
|
+ rconenabled=${rconenabled:-"NOT SET"}
|
|
|
rconpassword=${rconpassword:-"NOT SET"}
|
|
|
port=${port:-"21025"}
|
|
|
queryport=${queryport:-"21025"}
|
|
|
@@ -853,11 +890,9 @@ fn_info_config_squad(){
|
|
|
maxplayers=${maxplayers:-"0"}
|
|
|
}
|
|
|
|
|
|
-# Just Cause 2
|
|
|
-if [ "${engine}" == "avalanche" ]; then
|
|
|
- fn_info_config_avalanche
|
|
|
+
|
|
|
# ARK: Survival Evolved
|
|
|
-elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
|
|
|
+if [ "${gamename}" == "ARK: Survivial Evolved" ]; then
|
|
|
fn_info_config_ark
|
|
|
# Ballistic Overkill
|
|
|
elif [ "${gamename}" == "Ballistic Overkill" ]; then
|
|
|
@@ -883,6 +918,12 @@ elif [ "${engine}" == "dontstarve" ]; then
|
|
|
# Factorio
|
|
|
elif [ "${gamename}" == "Factorio" ]; then
|
|
|
fn_info_config_factorio
|
|
|
+# Just Cause 2
|
|
|
+elif [ "${gamename}" == "Just Cause 2" ]; then
|
|
|
+ fn_info_config_justcause2
|
|
|
+# Just Cause 3
|
|
|
+elif [ "${gamename}" == "Just Cause 3" ]; then
|
|
|
+ fn_info_config_justcause3
|
|
|
# Killing Floor 2
|
|
|
elif [ "${shortname}" == "kf2" ]; then
|
|
|
fn_info_config_kf2
|