Browse Source

Merge branch 'develop' into feature/ns2_server_64_bit

pull/1735/head
Daniel Gibbs 7 years ago
committed by GitHub
parent
commit
bfb66c6ea0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ISSUE_TEMPLATE.md
  2. 2
      lgsm/config-default/config-lgsm/arma3server/_default.cfg
  3. 3
      lgsm/config-default/config-lgsm/csgoserver/_default.cfg
  4. 3
      lgsm/config-default/config-lgsm/gmodserver/_default.cfg
  5. 2
      lgsm/config-default/config-lgsm/jc2server/_default.cfg
  6. 115
      lgsm/config-default/config-lgsm/jc3server/_default.cfg
  7. 5
      lgsm/config-default/config-lgsm/rustserver/_default.cfg
  8. 7
      lgsm/config-default/config-lgsm/zpsserver/_default.cfg
  9. 1
      lgsm/data/serverlist.csv
  10. 2
      lgsm/functions/alert_mailgun.sh
  11. 8
      lgsm/functions/check_deps.sh
  12. 55
      lgsm/functions/check_ip.sh
  13. 2
      lgsm/functions/check_system_requirements.sh
  14. 2
      lgsm/functions/command_console.sh
  15. 2
      lgsm/functions/command_details.sh
  16. 2
      lgsm/functions/command_monitor.sh
  17. 2
      lgsm/functions/command_postdetails.sh
  18. 4
      lgsm/functions/command_start.sh
  19. 10
      lgsm/functions/command_stop.sh
  20. 4
      lgsm/functions/core_dl.sh
  21. 12
      lgsm/functions/fix_csgo.sh
  22. 6
      lgsm/functions/gsquery.py
  23. 53
      lgsm/functions/info_config.sh
  24. 2
      lgsm/functions/info_distro.sh
  25. 7
      lgsm/functions/info_glibc.sh
  26. 42
      lgsm/functions/info_messages.sh
  27. 8
      lgsm/functions/install_config.sh
  28. 2
      lgsm/functions/mods_list.sh
  29. 6
      lgsm/functions/update_factorio.sh
  30. 32
      linuxgsm.sh

8
ISSUE_TEMPLATE.md

@ -0,0 +1,8 @@
Please select the "Preview" tab above to view this message correctly.
Please note that this is an issue tracker for **LinuxGSM** related bugs and feature requests and **not** for the games themselves.
**Therefore personal server issues on GitHub will be closed without a kiss.**
Please follow **[this article](https://github.com/GameServerManagers/LinuxGSM/wiki/Support)** for optimal assistance
and do not forget to remove this text before opening the issue.

2
lgsm/config-default/config-lgsm/arma3server/_default.cfg

@ -33,7 +33,7 @@ bepath=""
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms="-netlog -ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory"
parms="-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory"
}
#### LinuxGSM Settings ####

3
lgsm/config-default/config-lgsm/csgoserver/_default.cfg

@ -11,11 +11,12 @@
## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
# https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server
# [Game Modes] gametype gamemode
# Arms Race 1 0
# Classic Casual 0 0
# Classic Competitive 0 1
# Arms Race 1 0
# Demolition 1 1
# Deathmatch 1 2
# Custom 3 0
gametype="0"
gamemode="0"
mapgroup="mg_active"

3
lgsm/config-default/config-lgsm/gmodserver/_default.cfg

@ -24,7 +24,8 @@ workshopcollectionid=""
## Custom Start Parameters
# Default +r_hunkalloclightmaps 0, fixes a start issue on maps with many lights
customparms="+r_hunkalloclightmaps 0"
# Default -disableluarefresh, disables autorefresh which should only be used when developing to avoid unwanted behavior
customparms="+r_hunkalloclightmaps 0 -disableluarefresh"
## Optional: Game Server Login Token
# GSLT can be used for running a public server.

2
lgsm/config-default/config-lgsm/jc2server/_default.cfg

@ -83,7 +83,7 @@ branch=""
## LinuxGSM Server Details
# Do not edit
gamename="Just Cause 2"
engine="avalanche"
engine="avalanche2.0"
#### Directories ####
# Edit with care

115
lgsm/config-default/config-lgsm/jc3server/_default.cfg

@ -0,0 +1,115 @@
##################################
######## Default Settings ########
##################################
# DO NOT EDIT WILL BE OVERWRITTEN!
# Copy settings from here and use them in either
# common.cfg - applies settings to every instance
# [instance].cfg - applies settings to a specific instance
#### Server Settings ####
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms=""
}
#### LinuxGSM Settings ####
## Notification Alerts
# (on|off)
# More info | https://github.com/GameServerManagers/LinuxGSM/wiki/Alerts#more-info
postalert="off"
postdays="7"
posttarget="https://hastebin.com"
# Discord Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Discord
discordalert="off"
discordwebhook="webhook"
# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
emailalert="off"
email="[email protected]"
emailfrom=""
# IFTTT Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/IFTTT
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# Mailgun Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/mailgun
mailgunalert="off"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="[email protected]"
mailgunemail="[email protected]"
# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""
# Pushover Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushover
pushoveralert="off"
pushovertoken="accesstoken"
# Telegram Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Telegram
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update
updateonstart="off"
## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
maxbackups="4"
maxbackupdays="30"
stoponbackup="on"
## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
consolelogging="on"
logdays="7"
#### LinuxGSM Advanced Settings ####
## SteamCMD Settings
# Server appid
appid="619960"
# Steam App Branch Select
# Allows to opt into the various Steam app branches. Default branch is "".
# Example: "-beta latest_experimental"
branch=""
## LinuxGSM Server Details
# Do not edit
gamename="Just Cause 3"
engine="avalanche3.0"
#### Directories ####
# Edit with care
## Server Specific Directories
systemdir="${serverfiles}"
executabledir="${serverfiles}"
executable="./Server"
servercfg="config.json"
servercfgdefault="config.json"
servercfgdir="${serverfiles}"
servercfgfullpath="${servercfgdir}/${servercfg}"
## Backup Directory
backupdir="${rootdir}/backups"
## Logging Directories
logdir="${rootdir}/log"
#gamelogdir="" # No server logs available
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
lgsmlog="${lgsmlogdir}/${servicename}-script.log"
consolelog="${consolelogdir}/${servicename}-console.log"
alertlog="${lgsmlogdir}/${servicename}-alert.log"
postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log"
## Logs Naming
lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

5
lgsm/config-default/config-lgsm/rustserver/_default.cfg

@ -26,9 +26,6 @@ tickrate="30" # default 30; range : 15 to 100
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile \"${gamelogdate}\""
}
# Specific to Rust
if [ -n "${seed}" ]; then
# If set, then add to start parms
@ -37,6 +34,8 @@ else
# Keep randomness of the number if not set
conditionalseed=""
fi
parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile \"${gamelogdate}\""
}
#### LinuxGSM Settings ####

7
lgsm/config-default/config-lgsm/zpsserver/_default.cfg

@ -16,14 +16,9 @@ sourcetvport="27020"
defaultmap="zps_deadend"
maxplayers="20"
## Optional: Game Server Login Token
# GSLT can be used for running a public server.
# More info: https://gameservermanagers.com/gslt
gslt=""
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
parms="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
}
#### LinuxGSM Settings ####

1
lgsm/data/serverlist.csv

@ -33,6 +33,7 @@ hldm,hldmserver,Half-Life: Deathmatch
hw,hwserver,Hurtworld
ins,insserver,Insurgency
jc2,jc2server,Just Cause 2
jc3,jc3server,Just Cause 3
kf,kfserver,Killing Floor
kf2,kf2server,Killing Floor 2
l4d,l4dserver,Left 4 Dead

1 arma3 arma3server ARMA 3
33 hw hwserver Hurtworld
34 ins insserver Insurgency
35 jc2 jc2server Just Cause 2
36 jc3 jc3server Just Cause 3
37 kf kfserver Killing Floor
38 kf2 kf2server Killing Floor 2
39 l4d l4dserver Left 4 Dead

2
lgsm/functions/alert_mailgun.sh

@ -11,7 +11,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Email alert: Mailgun: ${email}"
sleep 0.5
mailgunsend=$(curl -s --user "api:${mailguntoken}" \
mailgunsend=$(${curlpath} -s --user "api:${mailguntoken}" \
-F from="LinuxGSM <${mailgunemailfrom}>" \
-F to="LinuxGSM Admin <${mailgunemail}>" \
-F subject="${alertemoji} ${alertsubject} ${alertemoji}" \

8
lgsm/functions/check_deps.sh

@ -238,6 +238,8 @@ elif [ -n "$(command -v yum 2>/dev/null)" ]; then
# LinuxGSM requirements
if [ "${distroversion}" == "6" ]; then
array_deps_required=( curl wget util-linux-ng python file gzip bzip2 unzip binutils bc )
elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
array_deps_required=( curl wget util-linux python27 file gzip bzip2 unzip binutils bc )
else
array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc )
fi
@ -253,7 +255,11 @@ elif [ -n "$(command -v yum 2>/dev/null)" ]; then
# All servers except ts3,mumble,multitheftauto and minecraft servers require glibc.i686 and libstdc++.i686
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${engine}" != "lwjgl2" ]&&[ "${engine}" != "renderware" ]; then
array_deps_required+=( glibc.i686 libstdc++.i686 )
if [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
array_deps_required+=( glibc.i686 libstdc++64.i686 )
else
array_deps_required+=( glibc.i686 libstdc++.i686 )
fi
fi
# Game Specific requirements

55
lgsm/functions/check_ip.sh

@ -17,37 +17,62 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
getip=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
getipwc=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0)
info_config.sh
# IP is not set to specific IP
if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
fn_print_dots "Check IP"
sleep 1
# Multiple interfaces
if [ "${getipwc}" -ge "2" ]; then
fn_print_dots "Check IP"
sleep 1
fn_print_fail "Check IP: Multiple active network interfaces found."
fn_print_fail "Check IP: Multiple IP addresses found."
sleep 1
echo -en "\n"
# IP is set within game config
if [ "${ipsetinconfig}" == "1" ]; then
fn_print_information "Specify the IP you want to use within the game server config file ${servercfg}.\n"
echo -en "${servercfgfullpath}\n"
fn_print_information "Specify the IP you want to bind within ${servercfg}.\n"
echo -en " * location: ${servercfgfullpath}\n"
echo -en "\n"
echo -en "Set ${ipinconfigvar} to one of the following:\n"
fn_script_log_fatal "Multiple IP addresses found."
fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
# IP is set within LinuxGSM config
else
fn_print_information_nl "Specify the IP you want to use within a LinuxGSM config file."
echo -en "location: ${configdirserver}\n"
echo ""
fn_print_information_nl "Specify the IP you want to bind within a LinuxGSM config file.\n"
echo -en " * location: ${configdirserver}\n"
echo -en "\n"
echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
fn_script_log_fatal "Multiple IP addresses found."
if [ "${legacymode}" == "1" ]; then
fn_script_log_fatal "Specify the IP you want to bind within the ${selfname} script."
else
fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}."
fi
fi
echo -en "${getip}\n"
echo -en "\n"
echo -en "https://gameservermanagers.com/network-interfaces\n"
echo -en ""
fn_script_log_fatal "https://gameservermanagers.com/network-interfaces\n"
core_exit.sh
# Single interface
elif [ "${ipsetinconfig}" == "1" ]; then
fn_print_fail "Check IP: IP address not set in game config."
sleep 1
echo -en "\n"
fn_print_information "Specify the IP you want to bind within ${servercfg}.\n"
echo -en " * location: ${servercfgfullpath}\n"
echo -en "\n"
echo -en "Set ${ipinconfigvar} to the following:\n"
echo -en "${getip}\n"
echo -en "\n"
echo -en "https://gameservermanagers.com/network-interfaces\n"
echo -en ""
fn_script_log_fatal "Multiple active network interfaces found."
if [ "${legacymode}" == "1" ]; then
fn_script_log_fatal "Manually specify the IP you want to use within the ${selfname} script."
else
fn_script_log_fatal "Manually specify the IP you want to use within: ${configdirserver}."
fi
fn_script_log_fatal "IP address not set in game config."
fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
fn_script_log_fatal "https://gameservermanagers.com/network-interfaces\n"
core_exit.sh
else
ip=${getip}
ip="${getip}"
fi
fi
fi

2
lgsm/functions/check_system_requirements.sh

@ -14,7 +14,7 @@ info_distro.sh
if [ "${gamename}" == "ARK: Survival Evolved" ]; then
ramrequirementmb="4000"
ramrequirementgb="1"
ramrequirementgb="4"
elif [ "${gamename}" == "ARMA 3" ]; then
ramrequirementmb="1000"
ramrequirementgb="1"

2
lgsm/functions/command_console.sh

@ -30,7 +30,7 @@ if [ "${status}" != "0" ]; then
fn_print_ok_nl "Accessing console"
fn_script_log_pass "Console accessed"
sleep 1
tmux attach-session -t ${servicename}
tmux attach-session -t "=${servicename}"
fn_print_ok_nl "Closing console"
fn_script_log_pass "Console closed"
else

2
lgsm/functions/command_details.sh

@ -23,7 +23,7 @@ fn_info_message_gameserver
fn_info_message_script
fn_info_message_backup
# Some game servers do not have parms.
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]&&[ "${engine}" != "renderware" ]; then
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche2.0" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]&&[ "${engine}" != "renderware" ]; then
fn_parms
fn_info_message_commandlineparms
fi

2
lgsm/functions/command_monitor.sh

@ -79,7 +79,7 @@ fn_monitor_tmux(){
fn_print_ok_eol_nl
fn_script_log_pass "Checking session: OK"
# runs gsquery check on game with specific engines.
local allowed_engines_array=( avalanche goldsource idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 )
local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 )
for allowed_engine in "${allowed_engines_array[@]}"
do
if [ "${allowed_engine}" == "starbound" ]; then

2
lgsm/functions/command_postdetails.sh

@ -62,7 +62,7 @@ else
fn_info_message_script
fn_info_message_backup
# Some game servers do not have parms.
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]&&[ "${engine}" != "renderware" ]; then
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche2.0" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]&&[ "${engine}" != "renderware" ]; then
fn_parms
fn_info_message_commandlineparms
fi

4
lgsm/functions/command_start.sh

@ -110,7 +110,7 @@ fn_start_tmux(){
fn_script_log "Tmux version: master (user compiled)"
echo "Tmux version: master (user compiled)" >> "${consolelog}"
if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
tmux pipe-pane -o -t "=${servicename}" "exec cat >> '${consolelog}'"
fi
elif [ -n "${tmuxversion}" ]; then
# Get the digit version of tmux
@ -128,7 +128,7 @@ fn_start_tmux(){
Currently installed: $(tmux -V)" > "${consolelog}"
# Console logging enable or not set
elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
tmux pipe-pane -o -t "=${servicename}" "exec cat >> '${consolelog}'"
fi
else
echo "Unable to detect tmux version" >> "${consolelog}"

10
lgsm/functions/command_stop.sh

@ -14,7 +14,7 @@ fn_stop_graceful_ctrlc(){
fn_print_dots "Graceful: CTRL+c"
fn_script_log_info "Graceful: CTRL+c"
# sends quit
tmux send-keys C-c -t "${servicename}" > /dev/null 2>&1
tmux send-keys C-c -t "=${servicename}" > /dev/null 2>&1
# waits up to 30 seconds giving the server time to shutdown gracefuly
for seconds in {1..30}; do
check_status.sh
@ -44,7 +44,7 @@ fn_stop_graceful_cmd(){
fn_print_dots "Graceful: sending \"${1}\""
fn_script_log_info "Graceful: sending \"${1}\""
# sends specific stop command
tmux send -t "${servicename}" ${1} ENTER > /dev/null 2>&1
tmux send -t "=${servicename}" ${1} ENTER > /dev/null 2>&1
# waits up to given seconds giving the server time to shutdown gracefully
for ((seconds=1; seconds<=${2}; seconds++)); do
check_status.sh
@ -75,7 +75,7 @@ fn_stop_graceful_goldsource(){
fn_print_dots "Graceful: sending \"quit\""
fn_script_log_info "Graceful: sending \"quit\""
# sends quit
tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
tmux send -t "=${servicename}" quit ENTER > /dev/null 2>&1
# waits 3 seconds as goldsource servers restart with the quit command
for seconds in {1..3}; do
sleep 1
@ -189,7 +189,7 @@ fn_stop_graceful_select(){
fn_stop_graceful_cmd "quit" 120
elif [ "${engine}" == "goldsource" ]; then
fn_stop_graceful_goldsource
elif [ "${gamename}" == "Factorio" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]; then
elif [ "${engine}" == "avalanche2.0" ]||[ "${engine}" == "avalanche3.0" ]||[ "${gamename}" == "Factorio" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]; then
fn_stop_graceful_ctrlc
elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${engine}" == "Just Cause 2" ]||[ "${engine}" == "projectzomboid" ]; then
fn_stop_graceful_cmd "quit" 30
@ -261,7 +261,7 @@ fn_stop_tmux(){
fn_script_log_info "tmux kill-session: ${servername}"
sleep 0.5
# Kill tmux session
tmux kill-session -t "${servicename}" > /dev/null 2>&1
tmux kill-session -t "=${servicename}" > /dev/null 2>&1
sleep 0.5
check_status.sh
if [ "${status}" == "0" ]; then

4
lgsm/functions/core_dl.sh

@ -105,8 +105,8 @@ fn_fetch_file(){
forcedl="${6:-0}"
md5="${7:-0}"
# If the file is missing, then download
if [ ! -f "${local_filedir}/${local_filename}" ]; then
# download file if missing or download forced
if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then
if [ ! -d "${local_filedir}" ]; then
mkdir -p "${local_filedir}"
fi

12
lgsm/functions/fix_csgo.sh

@ -17,19 +17,19 @@ if [ ! -f "${serverfiles}/steam_appid.txt" ]; then
fi
# Fixes: Error parsing BotProfile.db - unknown attribute 'Rank'".
if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then
if [ -f "${systemdir}/botprofile.db" ] && grep "^\s*Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then
fixname="botprofile.db"
fn_fix_msg_start
sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1
sed -i 's/^\s*Rank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1
fn_fix_msg_end
fi
# Fixes: Unknown command "cl_bobamt_vert".
if ! grep -q "//exec default" "${servercfgdir}/valve.rc" > /dev/null 2>&1 || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc" > /dev/null 2>&1; then
# Fixes: Unknown command "cl_bobamt_vert" and exec: couldn't exec joystick.cfg.
if [ -f "${servercfgdir}/valve.rc" ] && grep -E '^\s*exec\s*(default|joystick)\.cfg' "${servercfgdir}/valve.rc" > /dev/null 2>&1; then
fixname="valve.rc"
fn_fix_msg_start
sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
sed -i 's/^\s*exec\s*default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
sed -i 's/^\s*exec\s*joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
fn_fix_msg_end
fi

6
lgsm/functions/gsquery.py

@ -17,7 +17,7 @@ class PythonGSQ:
self.server_response_timeout = 5
self.default_buffer_length = 1024
#
sourcequery=['madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d']
sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d']
idtech2query=['idtech3','quake','iw3.0']
idtech3query=['idtech2','iw2.0']
if self.option.engine in sourcequery:
@ -26,7 +26,7 @@ class PythonGSQ:
self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
elif self.option.engine in idtech3query:
self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
elif self.option.engine == 'avalanche':
elif self.option.engine == 'avalanche2.0':
self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
elif self.option.engine == 'unreal':
self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C'
@ -100,7 +100,7 @@ if __name__ == '__main__':
action='store',
dest='engine',
default=False,
help='Engine type: avalanche, goldsource, idtech2, idtech3, iw2.0, iw3.0, realvirtuality, quake, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
help='Engine type: avalanche2.0, avalanche3.0, goldsource, idtech2, idtech3, iw2.0, iw3.0, realvirtuality, quake, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
)
parser.add_option(
'-v', '--verbose',

53
lgsm/functions/info_config.sh

@ -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

2
lgsm/functions/info_distro.sh

@ -136,5 +136,5 @@ fi
# External IP address
if [ -z "${extip}" ];then
extip=$(curl -m 3 ifconfig.co 2>/dev/null)
extip=$(${curlpath} -m 3 ifconfig.co 2>/dev/null)
fi

7
lgsm/functions/info_glibc.sh

@ -107,9 +107,12 @@ elif [ "${gamename}" == "TeamSpeak 3" ]; then
elif [ "${gamename}" == "Teeworlds" ]; then
glibcrequired="2.14"
glibcfix="no"
elif [ "${engine}" == "avalanche" ]; then
elif [ "${gamename}" == "Just Cause 2" ]; then
glibcrequired="2.13"
glibcfix="yes"
elif [ "${gamename}" == "Just Cause 3" ]; then
glibcrequired="2.17"
glibcfix="no"
elif [ "${engine}" == "dontstarve" ]; then
glibcrequired="2.15"
glibcfix="no"
@ -133,7 +136,7 @@ elif [ "${engine}" == "goldsource" ]; then
glibcfix="no"
elif [ "${gamename}" == "Natural Selection 2" ]; then
glibcrequired="2.17"
glibcfix="yes"
glibcfix="no"
elif [ "${gamename}" == "NS2: Combat" ]; then
glibcrequired="2.15"
glibcfix="yes"

42
lgsm/functions/info_messages.sh

@ -126,6 +126,11 @@ fn_info_message_gameserver(){
echo -e "${blue}Server name:\t${default}${servername}"
fi
# Server description
if [ -n "${serverdescription}" ]; then
echo -e "${blue}Server Description:\t${default}${serverdescription}"
fi
# Branch
if [ -n "${branch}" ]; then
echo -e "${blue}Branch:\t${default}${branch}"
@ -397,7 +402,7 @@ fn_info_message_ports(){
parmslocation="${red}UNKNOWN${default}"
# engines/games that require editing in the config file
local ports_edit_array=( "avalanche" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
for port_edit in "${ports_edit_array[@]}"
do
if [ "${shortname}" == "ut3" ]; then
@ -502,15 +507,6 @@ fn_info_message_ballisticoverkill(){
} | column -s $'\t' -t
}
fn_info_message_avalanche(){
echo -e "netstat -atunp | grep Jcmp-Server"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\tudp"
} | column -s $'\t' -t
}
fn_info_message_cod(){
echo -e "netstat -atunp | grep cod_lnxded"
echo -e ""
@ -597,6 +593,26 @@ fn_info_message_hurtworld(){
} | column -s $'\t' -t
}
fn_info_message_justcause2(){
echo -e "netstat -atunp | grep Jcmp-Server"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\tudp"
} | column -s $'\t' -t
}
fn_info_message_justcause3(){
echo -e "netstat -atunp | grep Server"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> Query\tINBOUND\t${queryport}\tudp"
echo -e "> Steam\tINBOUND\t${steamport}\tudp"
} | column -s $'\t' -t
}
fn_info_message_minecraft(){
echo -e "netstat -atunp | grep java"
echo -e ""
@ -985,6 +1001,10 @@ fn_info_message_select_engine(){
fn_info_message_factorio
elif [ "${gamename}" == "Hurtworld" ]; then
fn_info_message_hurtworld
elif [ "${gamename}" == "Just Cause 2" ]; then
fn_info_message_justcause2
elif [ "${gamename}" == "Just Cause 3" ]; then
fn_info_message_justcause3
elif [ "${shortname}" == "kf2" ]; then
fn_info_message_kf2
elif [ "${gamename}" == "Project Cars" ]; then
@ -1013,8 +1033,6 @@ fn_info_message_select_engine(){
fn_info_message_rust
elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
fn_info_message_wolfensteinenemyterritory
elif [ "${engine}" == "avalanche" ]; then
fn_info_message_avalanche
elif [ "${engine}" == "refractor" ]; then
fn_info_message_refractor
elif [ "${engine}" == "dontstarve" ]; then

8
lgsm/functions/install_config.sh

@ -27,7 +27,7 @@ fn_fetch_default_config(){
mkdir -p "${lgsmdir}/config-default/config-game"
githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master"
for config in "${array_configs[@]}"; do
fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "noforce" "nomd5"
fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nomd5"
done
}
@ -336,6 +336,12 @@ elif [ "${gamename}" == "Just Cause 2" ]; then
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "Just Cause 3" ]; then
gamedirname="JustCause3"
array_configs+=( config.json )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "Killing Floor" ]; then
gamedirname="KillingFloor"
array_configs+=( Default.ini )

2
lgsm/functions/mods_list.sh

@ -68,7 +68,7 @@ mod_info_darkrpmodification=( MOD "darkrpmodification" "DarkRP Modification" "ht
# Oxidemod
mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-Rust.zip" "Oxide-Rust.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-rust.1659/" "Allows for the use of plugins" )
mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-Hurtworld.zip" "Oxide-Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-hurtworld.1332/" "Allows for the use of plugins" )
mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-SevenDays.zip" "Oxide-SevenDays.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" )
mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-SevenDaysToDie.zip" "Oxide-SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" )
# REQUIRED: Set all mods info into the global array
mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )

6
lgsm/functions/update_factorio.sh

@ -76,7 +76,11 @@ fn_update_factorio_arch(){
fn_update_factorio_availablebuild(){
# Gets latest build info.
availablebuild=$(curl -s https://www.factorio.com/download-headless/"${branch}" | grep 'headless/linux64' | head -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
if [ "${branch}" ]; then
availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless/"${branch}" | grep 'headless/linux64' | head -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
else
availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless | grep 'headless/linux64' | head -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
fi
sleep 1
# Checks if availablebuild variable has been set

32
linuxgsm.sh

@ -64,8 +64,8 @@ fn_bootstrap_fetch_file(){
run="${5:-0}"
forcedl="${6:-0}"
md5="${7:-0}"
# If the file is missing, then download
if [ ! -f "${local_filedir}/${local_filename}" ]; then
# download file if missing or download forced
if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then
if [ ! -d "${local_filedir}" ]; then
mkdir -p "${local_filedir}"
fi
@ -116,15 +116,15 @@ fn_bootstrap_fetch_file_github(){
github_file_url_name="${2}"
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_remote_fileurl="${githuburl}"
local_local_filedir="${3}"
local_local_filename="${github_file_url_name}"
remote_fileurl="${githuburl}"
local_filedir="${3}"
local_filename="${github_file_url_name}"
chmodx="${4:-0}"
run="${5:-0}"
forcedldl="${6:-0}"
forcedl="${6:-0}"
md5="${7:-0}"
# Passes vars to the file download function
fn_bootstrap_fetch_file "${remote_remote_fileurl}" "${local_local_filedir}" "${local_local_filename}" "${chmodx}" "${run}" "${forcedldl}" "${md5}"
fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
}
# Installer menu
@ -229,9 +229,9 @@ fn_install_getopt(){
echo "https://gameservermanagers.com"
echo -e ""
echo -e "Commands"
echo -e "install |Select server to install."
echo -e "servername |e.g $0 csgoserver. Enter the required servername will install it."
echo -e "list |List all servers available for install."
echo -e "install\t\t| Select server to install."
echo -e "servername\t| e.g $0 csgoserver. Enter name of server/game to install."
echo -e "list\t\t| List all servers available for install."
exit
}
@ -276,12 +276,8 @@ if [ "${shortname}" == "core" ]; then
datadir="${tmpdir}/data"
serverlist="${datadir}/serverlist.csv"
# Download the serverlist. This is the complete list of all supported servers.
if [ -f "${serverlist}" ]; then
rm "${serverlist}"
fi
fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "serverlist.csv" "nochmodx" "norun" "noforcedl" "nomd5"
# Download the latest serverlist. This is the complete list of all supported servers.
fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5"
if [ ! -f "${serverlist}" ]; then
echo "[ FAIL ] serverlist.csv could not be loaded."
exit 1
@ -307,8 +303,10 @@ if [ "${shortname}" == "core" ]; then
fi
elif [ -n "${userinput}" ]; then
fn_server_info
if [ "${userinput}" == "${gameservername}" ]; then
if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then
fn_install_file
else
echo "[ FAIL ] unknown game server"
fi
else
fn_install_getopt

Loading…
Cancel
Save