Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(newserver): Soldat #2445

Merged
merged 22 commits into from Aug 25, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
127 changes: 127 additions & 0 deletions lgsm/config-default/config-lgsm/sserver/_default.cfg
@@ -0,0 +1,127 @@
##################################
######## 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 Settings | https://docs.linuxgsm.com/configuration/start-parameters
ip="0.0.0.0"
port="23073"
maxplayers="32"
maplist="mapslist.txt"

## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){
parms="-b ${ip} -p ${port} -l ${maxplayers} -m ${maplist} -c ${servercfg}"
}

#### LinuxGSM Settings ####

## Notification Alerts
# (on|off)

# Display IP | https://docs.linuxgsm.com/alerts#display-ip
displayip=""

# More info | https://docs.linuxgsm.com/alerts#more-info
postalert="off"
postdays="7"
posttarget="https://hastebin.com"

# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
discordalert="off"
discordwebhook="webhook"

# Email Alerts | https://docs.linuxgsm.com/alerts/email
emailalert="off"
email="email@example.com"
emailfrom=""

# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"

# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
mailgunalert="off"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="alert@example.com"
mailgunemail="email@myemail.com"

# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""

# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
pushoveralert="off"
pushovertoken="accesstoken"

# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
# any custom string in curl - simple ignore this parameter.
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
curlcustomstring=""

## Backup | https://docs.linuxgsm.com/commands/backup
maxbackups="4"
maxbackupdays="30"
stoponbackup="on"

## Logging | https://docs.linuxgsm.com/features/logging
consolelogging="on"
logdays="7"

## Monitor | https://docs.linuxgsm.com/commands/monitor
# Query delay time
querydelay="1"

#### LinuxGSM Advanced Settings ####

# ANSI Colors
ansi="on"

# Message Display Time
sleeptime="0.5"

## LinuxGSM Server Details
# Do not edit
gamename="Soldat"
engine="soldat"
glibc="2.1"

#### Directories ####
# Edit with care

## Server Specific Directories
systemdir="${serverfiles}"
executabledir="${systemdir}"
executable="./soldatserver"
servercfg="soldat.ini"
servercfgdir="${systemdir}"
servercfgfullpath="${servercfgdir}/${servercfg}"

## Backup Directory
backupdir="${rootdir}/backups"

## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${serverfiles}/logs"
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"
1 change: 1 addition & 0 deletions lgsm/data/serverlist.csv
Expand Up @@ -73,6 +73,7 @@ samp,sampserver,San Andreas Multiplayer
sbots,sbotsserver, StickyBots
sfc,sfcserver,SourceForts Classic
sof2,sof2server,Soldier Of Fortune 2: Gold Edition
soldat,sserver,Soldat
ss3,ss3server,Serious Sam 3: BFE
sb,sbserver,Starbound
st,stserver,Stationeers
Expand Down
2 changes: 1 addition & 1 deletion lgsm/functions/command_stop.sh
Expand Up @@ -195,7 +195,7 @@ fn_stop_graceful_select(){
fn_stop_graceful_cmd "quit" 120
elif [ "${engine}" == "goldsource" ]; then
fn_stop_graceful_goldsource
elif [ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${shortname}" == "fctr" ]||[ "${shortname}" == "mumble" ]||[ "${shortname}" == "wurm" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "jc3" ]; then
elif [ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${shortname}" == "fctr" ]||[ "${shortname}" == "mumble" ]||[ "${shortname}" == "wurm" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "jc3" ]||[ "${shortname}" == "soldat" ]; then
fn_stop_graceful_ctrlc
elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${shortname}" == "pz" ]||[ "${shortname}" == "rw" ]; then
fn_stop_graceful_cmd "quit" 30
Expand Down
15 changes: 15 additions & 0 deletions lgsm/functions/info_config.sh
Expand Up @@ -1212,6 +1212,18 @@ fn_info_config_mordhau(){
fi
}

fn_info_config_soldat(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
serverpassword="${unavailable}"
adminpassword="${unavailable}"
else
servername=$(grep "Server_Name" "${servercfgfullpath}" | awk -F '=' '{print $2}')
serverpassword=$(grep "Game_Password" "${servercfgfullpath}" | awk -F '=' '{print $2}')
adminpassword=$(grep "Admin_Password" "${servercfgfullpath}" | awk -F '=' '{print $2}')
fi
}

# ARK: Survival Evolved
if [ "${shortname}" == "ark" ]; then
fn_info_config_ark
Expand Down Expand Up @@ -1296,6 +1308,9 @@ elif [ "${shortname}" == "rw" ]; then
# Serious Sam
elif [ "${shortname}" == "ss3" ]; then
fn_info_config_seriousengine35
# Soldat
elif [ "${shortname}" == "soldat" ]; then
fn_info_config_soldat
# Soldier Of Fortune 2: Gold Edition
elif [ "${shortname}" == "sof2" ]; then
fn_info_config_sof2
Expand Down
14 changes: 13 additions & 1 deletion lgsm/functions/info_messages.sh
Expand Up @@ -501,7 +501,7 @@ fn_info_message_ports(){
fi
done
# engines/games that require editing the parms
local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned")
local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" "Soldat" )
for port_edit in "${ports_edit_array[@]}"
do
if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
Expand Down Expand Up @@ -1215,6 +1215,16 @@ fn_info_message_barotrauma(){
} | column -s $'\t' -t
}

fn_info_message_soldat() {
echo "netstat -atunp | grep soldat"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> RCON\tINBOUND\t${port}\ttcp"
echo -e "> FILES\tINBOUND\t$((port+10))\ttcp"
} | column -s $'\t' -t
}

fn_info_message_select_engine(){
# Display details depending on game or engine.
Expand Down Expand Up @@ -1272,6 +1282,8 @@ fn_info_message_select_engine(){
fn_info_message_squad
elif [ "${gamename}" == "Stationeers" ]; then
fn_info_message_stationeers
elif [ "${gamename}" == "Soldat" ]; then
fn_info_message_soldat
elif [ "${shortname}" == "sbots" ]; then
fn_info_message_sbots
elif [ "${gamename}" == "TeamSpeak 3" ]; then
Expand Down
10 changes: 10 additions & 0 deletions lgsm/functions/info_parms.sh
Expand Up @@ -157,6 +157,14 @@ fn_info_parms_sof2(){
defaultmap=${defaultmap:-"NOT SET"}
}

fn_info_parms_soldat(){
port=${port:-"0"}
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
adminpassword=${adminpassword:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
}

fn_info_parms_towerunite(){
port=${port:-"0"}
queryport=${queryport:-"0"}
Expand Down Expand Up @@ -239,6 +247,8 @@ elif [ "${shortname}" == "sof2" ]; then
# Sticky Bots
elif [ "${shortname}" == "sbots" ]; then
fn_info_parms_stickybots
elif [ "${shortname}" == "soldat" ]; then
fn_info_parms_soldat
# Serious Sam
elif [ "${shortname}" == "ss3" ]; then
fn_info_parms_seriousengine35
Expand Down
6 changes: 6 additions & 0 deletions lgsm/functions/install_config.sh
Expand Up @@ -549,6 +549,12 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "Soldat" ]; then
gamedirname="Soldat"
array_configs+=( soldat.ini )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "Soldier Of Fortune 2: Gold Edition" ]; then
gamedirname="SoldierOfFortune2Gold"
array_configs+=( server.cfg mapcycle.txt)
Expand Down
4 changes: 3 additions & 1 deletion lgsm/functions/install_server_files.sh
Expand Up @@ -57,6 +57,8 @@ fn_install_server_files(){
remote_fileurl="https://files.linuxgsm.com/WolfensteinEnemyTerritory/enemy-territory.260b.tar.bz2"; local_filedir="${tmpdir}"; local_filename="enemy-territory.260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="f833f514bfcdd46b42c111f83350c5a7"
elif [ "${shortname}" == "samp" ]; then
remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz"; local_filedir="${tmpdir}"; local_filename="samp037svr_R2-1.tar.gz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="93705e165550c97484678236749198a4"
elif [ "${shortname}" == "soldat" ]; then
remote_fileurl="https://static.soldat.pl/downloads/soldatserver2.8.1_1.7.1.zip"; local_filedir="${tmpdir}"; local_filename="soldatserver2.8.1_1.7.1.zip"; chmodx="nochmodx" run="norun"; force="noforce"; md5="994409c28520425965dec5c71ccb55e1"
elif [ "${shortname}" == "zmr" ]; then
remote_fileurl="https://files.linuxgsm.com/ZombieMasterReborn/zombie_master_reborn_b4_fix5.1.tar.bz2"; local_filedir="${tmpdir}"; local_filename="zombie_master_reborn_b4_fix5.1.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="73472bd84dfa6d203f3b5f48f760773e"
fi
Expand Down Expand Up @@ -157,7 +159,7 @@ elif [ "${shortname}" == "mta" ]; then
elif [ "${shortname}" == "fctr" ]; then
update_factorio.sh
install_factorio_save.sh
elif [ -z "${appid}" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then
elif [ -z "${appid}" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "soldat" ]; then
if [ "${shortname}" == "ut" ]; then
install_eula.sh
fi
Expand Down