From c38f09c2ca4927286f35e2672ced6901d141e030 Mon Sep 17 00:00:00 2001 From: h3o66 Date: Sun, 9 Jun 2019 18:56:11 +0200 Subject: [PATCH] feat(pvrserver): add new server --- .../config-lgsm/pvrserver/_default.cfg | 133 ++++++++++++++++++ lgsm/data/serverlist.csv | 1 + lgsm/functions/check_system_requirements.sh | 3 + lgsm/functions/fix_steamcmd.sh | 8 ++ lgsm/functions/info_config.sh | 16 +++ lgsm/functions/info_messages.sh | 12 ++ lgsm/functions/info_parms.sh | 7 + lgsm/functions/install_config.sh | 7 + 8 files changed, 187 insertions(+) create mode 100644 lgsm/config-default/config-lgsm/pvrserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg new file mode 100644 index 0000000000..3a10d8423b --- /dev/null +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -0,0 +1,133 @@ +################################## +######## 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="7000" + +# Maps: bridge, datacenter, sand +defaultmap="datacenter" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="${defaultmap} -log -MultiHome=${ip} -Port=${port}" +} + +#### 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" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="622970" +# 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="Pavlov VR" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Pavlov" +executabledir="${systemdir}/Binaries/Linux" +executable="./PavlovServer" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index b9494beded..df3268ab42 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -55,6 +55,7 @@ ns,nsserver,Natural Selection ns2,ns2server,Natural Selection 2 ns2c,ns2cserver,NS2: Combat opfor,opforserver,Opposing Force +pvr,pvrserver,Pavlov VR pstbs,pstbsserver,Post Scriptum: The Bloody Seventh pvkii,pvkiiserver,Pirates Vikings & Knights II pc,pcserver,Project Cars diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index d0cf9bf8dc..5e06ffce34 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -36,6 +36,9 @@ elif [ "${shortname}" == "ns2" ]||[ "${shortname}" == "ns2c" ]; then elif [ "${shortname}" == "st" ]; then ramrequirementmb="1000" ramrequirementgb="1" +elif [ "${shortname}" == "pvr" ];then + ramrequirementmb="2000" + ramrequirementgb="2" fi # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index a3f60e89c3..6902f4d5e8 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -48,4 +48,12 @@ elif [ "${shortname}" == "tu" ]; then cp -v "${serverfiles}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" fn_fix_msg_end fi +elif [ "${shortname}" == "pvr" ]; then + # Fixes: [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed. + if [ ! -L "${executabledir}/steamclient.so" ]; then + fixname="steamclient.so" + fn_fix_msg_start + cp -s -v "${serverfiles}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" + fn_fix_msg_end + fi fi diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 11ddb95ec9..9dbc130561 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -1189,6 +1189,20 @@ fn_info_config_mordhau(){ fi } +fn_info_config_pavlovvr(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + # ARK: Survival Evolved if [ "${shortname}" == "ark" ]; then fn_info_config_ark @@ -1324,4 +1338,6 @@ elif [ "${shortname}" == "st" ]; then fn_info_config_stationeers elif [ "${shortname}" == "mh" ]; then fn_info_config_mordhau +elif [ "${shortname}" == "pvr" ];then + fn_info_config_pavlovvr fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 4c1b960c4f..861e4e0614 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -1200,6 +1200,16 @@ fn_info_message_mordhau(){ } | column -s $'\t' -t } +fn_info_message_pavlovvr(){ + echo "netstat -atunp | grep Pavlov" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Ping\tINBOUND\t7\timcp" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + fn_info_message_select_engine(){ # Display details depending on game or engine. if [ "${gamename}" == "7 Days To Die" ]; then @@ -1268,6 +1278,8 @@ fn_info_message_select_engine(){ fn_info_message_mta elif [ "${gamename}" == "Mumble" ]; then fn_info_message_mumble + elif [ "${shortname}" == "pvr" ]; then + fn_info_message_pavlovvr elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then fn_info_message_rtcw elif [ "${gamename}" == "Rust" ]; then diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 7b080036d7..9ee5828a80 100644 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -163,6 +163,11 @@ fn_info_parms_mordhau(){ beaconport=${beaconport:-"0"} } +fn_info_parms_pavlovvr(){ + port=${port:-"0"} + queryport=${queryport:-"0"} +} + fn_info_parms_unreal(){ defaultmap=${defaultmap:-"NOT SET"} queryport=$((port + 1)) @@ -243,6 +248,8 @@ elif [ "${shortname}" == "tu" ]; then fn_info_parms_towerunite elif [ "${shortname}" == "mh" ]; then fn_info_parms_mordhau +elif [ "${shortname}" == "pvr" ]; then + fn_info_parms_pavlovvr # Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then fn_info_parms_unreal diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index cb5a431ad6..330afb592f 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -463,6 +463,13 @@ elif [ "${gamename}" == "Mumble" ]; then array_configs+=( murmur.ini ) fn_fetch_default_config fn_default_config_remote +elif [ "${gamename}" == "Pavlov VR" ]; then + gamedirname="PavlovVR" + fn_check_cfgdir + array_configs+=( Game.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then gamedirname="PiratesVikingandKnightsII" array_configs+=( server.cfg )