diff --git a/lgsm/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg new file mode 100644 index 000000000..5be0776cf --- /dev/null +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -0,0 +1,178 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES 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. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 +fn_parms(){ +parms="-batchmode -nographics +server.config ${servercfgfullpath}" +} + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## 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" + +# 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" +mailgunapiregion="us" +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" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +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" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="748090" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Colony Survival" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./colonyserver.x86_64" +servercfgdir="${systemdir}/gamedata/settings" +servercfg="${selfname}.json" +servercfgdefault="colserver.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/gamedata/logs/server/" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index ad3bc9a19..7786158f1 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -21,6 +21,7 @@ cod2,cod2server,Call of Duty 2 cod4,cod4server,Call of Duty 4 coduo,coduoserver,Call of Duty: United Offensive codwaw,codwawserver,Call of Duty: World at War +col,colserver,Colony Survival cs,csserver,Counter-Strike 1.6 cscz,csczserver,Counter-Strike: Condition Zero csgo,csgoserver,Counter-Strike: Global Offensive diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 80d33cad9..29c1c4548 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -404,6 +404,9 @@ fn_deps_build_debian(){ # Barotrauma elif [ "${shortname}" == "bt" ]; then array_deps_required+=( libicu-dev ) + # Colony Survival + elif [ "${shortname}" == "col" ]; then + array_deps_required+=( coreutils ) # Ecoserver elif [ "${shortname}" == "eco" ]; then array_deps_required+=( libgdiplus ) @@ -513,6 +516,9 @@ fn_deps_build_redhat(){ # Call of Duty & Medal of Honor: Allied Assault elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then array_deps_required+=( compat-libstdc++-33.i686 ) + # Colony Survival + elif [ "${shortname}" == "col" ]; then + array_deps_required+=( coreutils ) # Ecoserver elif [ "${shortname}" == "eco" ]; then array_deps_required+=( libgdiplus ) diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 41d31e263..01465b45e 100755 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -79,6 +79,8 @@ elif [ "${shortname}" == "cmw" ]; then fn_fix_steamclient_so "32" "${executabledir}/lib" elif [ "${shortname}" == "cs" ]; then fn_fix_steamclient_so "32" "${serverfiles}" +elif [ "${shortname}" == "col" ]; then + fn_fix_steamclient_so "64" "${serverfiles}" elif [ "${shortname}" == "ins" ]; then fn_fix_steamclient_so "32" "${serverfiles}/bin" elif [ "${shortname}" == "pz" ]; then diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index d13e000d9..99eed24c4 100755 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -1525,6 +1525,29 @@ fn_info_config_pavlovvr(){ fi } +fn_info_config_col(){ + if [ -f "${servercfgfullpath}" ]; then + servername=$(jq -r '.ServerSettings.ServerName' "${servercfgfullpath}") + serverpassword=$(jq -r '.ServerSettings.ServerPassword' "${servercfgfullpath}") + maxplayers=$(jq -r '.ServerSettings.MaxPlayerCount' "${servercfgfullpath}") + port=$(jq -r '.ServerSettings.ServerGamePort' "${servercfgfullpath}") + steamport=$(jq -r '.ServerSettings.ServerSteamPort' "${servercfgfullpath}") + rconpassword=$(jq -r '.ServerSettings.RCONPassword' "${servercfgfullpath}") + configip=$(jq -r '.ServerSettings.ServerIP' "${servercfgfullpath}") + + # password not set + serverpassword=${serverpassword:-"NOT SET"} + queryport=${port:-"0"} + else + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27004"} + steamport=${steamport:-"27005"} + rconpassword=${rconpassword:-"NOT SET"} + fi +} + if [ "${shortname}" == "ac" ]; then fn_info_config_assettocorsa elif [ "${shortname}" == "ark" ]; then @@ -1551,6 +1574,8 @@ elif [ "${shortname}" == "cod4" ]; then fn_info_config_cod4 elif [ "${shortname}" == "codwaw" ]; then fn_info_config_codwaw +elif [ "${shortname}" == "col" ]; then + fn_info_config_col elif [ "${shortname}" == "dst" ]; then fn_info_config_dontstarve elif [ "${shortname}" == "eco" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index dde3a2585..c6a1b996f 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -583,7 +583,7 @@ fn_info_message_ports(){ fi done # engines/games that require editing the parms. - local ports_edit_array=( "Avorion" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" ) + local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" ) for port_edit in "${ports_edit_array[@]}"; do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then parmslocation="${configdirserver}" @@ -1445,6 +1445,16 @@ fn_info_message_pavlovvr(){ } | column -s $'\t' -t } +fn_info_message_colony(){ + echo -e "netstat -atunp | grep colonyserver" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Steam\tINBOUND\t${steamport}\tudp" + } | column -s $'\t' -t +} + fn_info_message_select_engine(){ # Display details depending on game or engine. if [ "${shortname}" == "ac" ]; then @@ -1473,6 +1483,8 @@ fn_info_message_select_engine(){ fn_info_message_cod4 elif [ "${shortname}" == "codwaw" ]; then fn_info_message_codwaw + elif [ "${shortname}" == "col" ]; then + fn_info_message_colony elif [ "${shortname}" == "dst" ]; then fn_info_message_dst elif [ "${shortname}" == "eco" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index fbff9dbbb..052e535d2 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -316,6 +316,13 @@ elif [ "${shortname}" == "cc" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "col" ]; then + gamedirname="ColonySurvival" + array_configs+=( colserver.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "cs" ]; then gamedirname="CounterStrike" array_configs+=( server.cfg )