Skip to content

Commit

Permalink
feat(newserver): Unturned (#2296)
Browse files Browse the repository at this point in the history
Co-authored-by: admin@heihachi.pw
  • Loading branch information
heihachi authored and dgibbs64 committed May 3, 2019
1 parent 2a2e734 commit 7734a35
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 3 deletions.
136 changes: 136 additions & 0 deletions lgsm/config-default/config-lgsm/untserver/_default.cfg
@@ -0,0 +1,136 @@
##################################
######## 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="27015"
maxplayers="20"
defaultmap="pei"

## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login
steamuser="username"
steampass='password'

## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters

# Parameters are changed in game.ini and engine.ini (Location: ${systemdir}/Saved/Config/LinuxServer)
# Make sure you change the admin password before launching the server

fn_parms(){
parms="-port:${port} -players:${maxplayers} --nographics -${defaultmap} -batchmode +secureserver/${servicename}"
}

#### LinuxGSM Settings ####

## Notification Alerts
# (on|off)

# 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=""

## Updating | https://docs.linuxgsm.com/commands/update
updateonstart="off"

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

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

#### LinuxGSM Advanced Settings ####

# ANSI Colors
ansi="on"

## SteamCMD Settings
# Server appid
appid="304930"
# 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="Unturned"
engine="unity3d"

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

## Server Specific Directories
systemdir="${serverfiles}"
executabledir="${serverfiles}"
executable="./Unturned_Headless.x86"
servercfgdir="${systemdir}/Servers/${servicename}"
servercfg="Config.json"
servercfgdefault="Config.json"
servercfgfullpath="${servercfgdir}/${servercfg}"

## Backup Directory
backupdir="${lgsmdir}/backup"

## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${logdir}/server"
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 @@ -83,6 +83,7 @@ tu,tuserver,Tower Unite
ut2k4,ut2k4server,Unreal Tournament 2004 ut2k4,ut2k4server,Unreal Tournament 2004
ut3,ut3server,Unreal Tournament 3 ut3,ut3server,Unreal Tournament 3
ut99,ut99server,Unreal Tournament 99 ut99,ut99server,Unreal Tournament 99
unt,untserver,Unturned
vs,vsserver,Vampire Slayer vs,vsserver,Vampire Slayer
wet,wetserver,Wolfenstein: Enemy Territory wet,wetserver,Wolfenstein: Enemy Territory
wurm,wurmserver,Wurm Unlimited wurm,wurmserver,Wurm Unlimited
Expand Down
2 changes: 2 additions & 0 deletions lgsm/functions/command_validate.sh
Expand Up @@ -27,6 +27,8 @@ fn_validation(){


if [ "${appid}" == "90" ]; then if [ "${appid}" == "90" ]; then
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}" ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}"
elif [ "${gamename}" == "Unturned" ]; then
${unbuffer} /steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit
else else
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}" ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}"
fi fi
Expand Down
5 changes: 5 additions & 0 deletions lgsm/functions/core_functions.sh
Expand Up @@ -402,6 +402,11 @@ functionfile="${FUNCNAME}"
fn_fetch_function fn_fetch_function
} }


fix_unt.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}

fix_wurm.sh(){ fix_wurm.sh(){
functionfile="${FUNCNAME}" functionfile="${FUNCNAME}"
fn_fetch_function fn_fetch_function
Expand Down
2 changes: 2 additions & 0 deletions lgsm/functions/fix.sh
Expand Up @@ -69,6 +69,8 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th
fix_ts3.sh fix_ts3.sh
elif [ "${shortname}" == "mta" ]; then elif [ "${shortname}" == "mta" ]; then
fix_mta.sh fix_mta.sh
elif [ "${shortname}" == "unt" ]; then
fix_unt.sh
elif [ "${shortname}" == "wurm" ]; then elif [ "${shortname}" == "wurm" ]; then
fix_wurm.sh fix_wurm.sh
fi fi
Expand Down
11 changes: 11 additions & 0 deletions lgsm/functions/fix_unt.sh
@@ -0,0 +1,11 @@
#!/bin/bash
# LinuxGSM fix_rust.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Resolves startup issue with Unturned

local commandname="FIX"
local commandaction="Fix"

# Fixes: [Raknet] Server Shutting Down (Shutting Down)
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/lib"
3 changes: 3 additions & 0 deletions lgsm/functions/info_glibc.sh
Expand Up @@ -165,6 +165,9 @@ elif [ "${gamename}" == "Wurm Unlimited" ]; then
elif [ "${gamename}" == "Multi Theft Auto" ]; then elif [ "${gamename}" == "Multi Theft Auto" ]; then
glibcrequired="2.7" glibcrequired="2.7"
glibcfix="no" glibcfix="no"
elif [ "${gamename}" == "Unturned" ]; then
glibcrequired="2.15"
glibcfix="no"
elif [ "${gamename}" == "Zombie Panic! Source" ]; then elif [ "${gamename}" == "Zombie Panic! Source" ]; then
glibcrequired="2.15" glibcrequired="2.15"
glibcfix="yes" glibcfix="yes"
Expand Down
14 changes: 13 additions & 1 deletion lgsm/functions/info_messages.sh
Expand Up @@ -495,7 +495,7 @@ fn_info_message_ports(){
fi fi
done done
# engines/games that require editing the parms # engines/games that require editing the parms
local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality") local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned")
for port_edit in "${ports_edit_array[@]}" for port_edit in "${ports_edit_array[@]}"
do do
if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
Expand Down Expand Up @@ -1107,6 +1107,16 @@ fn_info_message_unreal3(){
} | column -s $'\t' -t } | column -s $'\t' -t
} }


fn_info_message_unturned(){
echo -e "netstat -atunp | grep Unturned"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> Query\tINBOUND\t${queryport}\tudp"
} | column -s $'\t' -t
}

fn_info_message_kf2(){ fn_info_message_kf2(){
echo -e "netstat -atunp | grep KFGame" echo -e "netstat -atunp | grep KFGame"
echo -e "" echo -e ""
Expand Down Expand Up @@ -1229,6 +1239,8 @@ fn_info_message_select_engine(){
fn_info_message_teamspeak3 fn_info_message_teamspeak3
elif [ "${gamename}" == "Tower Unite" ]; then elif [ "${gamename}" == "Tower Unite" ]; then
fn_info_message_towerunite fn_info_message_towerunite
elif [ "${shortname}" == "unt" ]; then
fn_info_message_unturned
elif [ "${gamename}" == "Multi Theft Auto" ]; then elif [ "${gamename}" == "Multi Theft Auto" ]; then
fn_info_message_mta fn_info_message_mta
elif [ "${gamename}" == "Mumble" ]; then elif [ "${gamename}" == "Mumble" ]; then
Expand Down
7 changes: 7 additions & 0 deletions lgsm/functions/info_parms.sh
Expand Up @@ -164,6 +164,11 @@ fn_info_parms_unreal3(){
adminpassword=${adminpassword:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"}
} }


fn_info_parms_unturned(){
servername=${servicename:-"NOT SET"}
port=${port:-"0"}
queryport=$((port + 1))
}
fn_info_parms_kf2(){ fn_info_parms_kf2(){
queryport=${queryport:-"0"} queryport=${queryport:-"0"}
defaultmap=${defaultmap:-"NOT SET"} defaultmap=${defaultmap:-"NOT SET"}
Expand Down Expand Up @@ -222,4 +227,6 @@ elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
# Unreal 3 engine # Unreal 3 engine
elif [ "${engine}" == "unreal3" ]; then elif [ "${engine}" == "unreal3" ]; then
fn_info_parms_unreal3 fn_info_parms_unreal3
elif [ "${shortname}" == "unt" ]; then
fn_info_parms_unturned
fi fi
6 changes: 6 additions & 0 deletions lgsm/functions/install_config.sh
Expand Up @@ -607,6 +607,12 @@ elif [ "${gamename}" == "Unreal Tournament 99" ]; then
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
elif [ "${shortname}" == "unt" ]; then
gamedirname="Unturned"
array_configs+=( Config.json )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "Vampire Slayer" ]; then elif [ "${gamename}" == "Vampire Slayer" ]; then
gamedirname="VampireSlayer" gamedirname="VampireSlayer"
array_configs+=( server.cfg ) array_configs+=( server.cfg )
Expand Down
3 changes: 3 additions & 0 deletions lgsm/functions/install_server_files.sh
Expand Up @@ -92,6 +92,9 @@ fn_install_server_files_steamcmd(){
if [ "${appid}" == "90" ]; then if [ "${appid}" == "90" ]; then
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit
local exitcode=$? local exitcode=$?
elif [ "${shortname}" == "unt" ]; then
${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit
local exitcode=$?
else else
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit
local exitcode=$? local exitcode=$?
Expand Down
6 changes: 4 additions & 2 deletions lgsm/functions/update_steamcmd.sh
Expand Up @@ -20,6 +20,8 @@ fn_update_steamcmd_dl(){
cd "${steamcmddir}" || exit cd "${steamcmddir}" || exit
if [ "${appid}" == "90" ]; then if [ "${appid}" == "90" ]; then
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}" ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}"
elif [ "${shortname}" == "unt" ]; then
${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit
else else
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}" ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}"
fi fi
Expand Down Expand Up @@ -73,7 +75,7 @@ fn_update_steamcmd_remotebuild(){
fn_script_log_fatal "Unable to get remote build" fn_script_log_fatal "Unable to get remote build"
core_exit.sh core_exit.sh
fi fi
fi fi
} }


fn_update_steamcmd_compare(){ fn_update_steamcmd_compare(){
Expand Down Expand Up @@ -134,7 +136,7 @@ fn_update_steamcmd_compare(){
if [ -v "${branch}" ]; then if [ -v "${branch}" ]; then
echo -e "* Branch: ${branch}" echo -e "* Branch: ${branch}"
fi fi
echo -e "https://steamdb.info/app/${appid}/" echo -e "https://steamdb.info/app/${appid}/"
fn_script_log_info "No update available" fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "Remote build: ${remotebuild}"
Expand Down

0 comments on commit 7734a35

Please sign in to comment.