Skip to content

Commit eaefc57

Browse files
h3o66dgibbs64
andauthored
feat(newserver): Survive the Nights (#3427)
* feat(newserver): Survive the Nights * add gotify * update info_config * verbose console * added missing dodr stuff Co-authored-by: Daniel Gibbs <[email protected]>
1 parent 3cfabd6 commit eaefc57

File tree

6 files changed

+238
-1
lines changed

6 files changed

+238
-1
lines changed

lgsm/config-default/config-lgsm/dodrserver/_default.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ emailalert="off"
4343
4444
emailfrom=""
4545

46+
# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify
47+
gotifyalert="off"
48+
gotifytoken="token"
49+
gotifywebhook="webhook"
50+
4651
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
4752
iftttalert="off"
4853
ifttttoken="accesstoken"
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
##################################
2+
######## Default Settings ########
3+
##################################
4+
# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN!
5+
# Copy settings from here and use them in either:
6+
# common.cfg - applies settings to every instance.
7+
# [instance].cfg - applies settings to a specific instance.
8+
9+
#### Game Server Settings ####
10+
maxplayers="20"
11+
# Regions: USA: 0, EU: 1, AUS: 2
12+
region="0"
13+
14+
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
15+
# Edit with care | https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29
16+
startparameters="-mc ${maxplayers} -r ${region}"
17+
18+
#### LinuxGSM Settings ####
19+
20+
## LinuxGSM Stats
21+
# Send useful stats to LinuxGSM developers.
22+
# https://docs.linuxgsm.com/configuration/linuxgsm-stats
23+
# (on|off)
24+
stats="off"
25+
26+
## Notification Alerts
27+
# (on|off)
28+
29+
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
30+
displayip=""
31+
32+
# More info | https://docs.linuxgsm.com/alerts#more-info
33+
postalert="off"
34+
35+
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
36+
discordalert="off"
37+
discordwebhook="webhook"
38+
39+
# Email Alerts | https://docs.linuxgsm.com/alerts/email
40+
emailalert="off"
41+
42+
emailfrom=""
43+
44+
# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify
45+
gotifyalert="off"
46+
gotifytoken="token"
47+
gotifywebhook="webhook"
48+
49+
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
50+
iftttalert="off"
51+
ifttttoken="accesstoken"
52+
iftttevent="linuxgsm_alert"
53+
54+
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
55+
mailgunalert="off"
56+
mailgunapiregion="us"
57+
mailguntoken="accesstoken"
58+
mailgundomain="example.com"
59+
mailgunemailfrom="[email protected]"
60+
mailgunemail="[email protected]"
61+
62+
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
63+
pushbulletalert="off"
64+
pushbullettoken="accesstoken"
65+
channeltag=""
66+
67+
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
68+
pushoveralert="off"
69+
pushovertoken="accesstoken"
70+
pushoveruserkey="userkey"
71+
72+
# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
73+
rocketchatalert="off"
74+
rocketchatwebhook="webhook"
75+
rocketchattoken=""
76+
77+
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
78+
slackalert="off"
79+
slackwebhook="webhook"
80+
81+
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
82+
# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring".
83+
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help".
84+
telegramapi="api.telegram.org"
85+
telegramalert="off"
86+
telegramtoken="accesstoken"
87+
telegramchatid=""
88+
curlcustomstring=""
89+
90+
## Updating | https://docs.linuxgsm.com/commands/update
91+
updateonstart="off"
92+
93+
## Backup | https://docs.linuxgsm.com/commands/backup
94+
maxbackups="4"
95+
maxbackupdays="30"
96+
stoponbackup="on"
97+
98+
## Logging | https://docs.linuxgsm.com/features/logging
99+
consolelogging="on"
100+
logdays="7"
101+
102+
## Monitor | https://docs.linuxgsm.com/commands/monitor
103+
# Query delay time
104+
querydelay="1"
105+
106+
## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
107+
ansi="on"
108+
109+
#### Advanced Settings ####
110+
111+
## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
112+
sleeptime="0.5"
113+
114+
## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd
115+
# Server appid
116+
appid="1502300"
117+
steamcmdforcewindows="no"
118+
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
119+
branch=""
120+
betapassword=""
121+
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
122+
steammaster="false"
123+
124+
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
125+
# 1: tmux kill
126+
# 2: CTRL+c
127+
# 3: quit
128+
# 4: quit 120s
129+
# 5: stop
130+
# 6: q
131+
# 7: exit
132+
# 8: 7 Days to Die
133+
# 9: GoldSrc
134+
# 10: Avorion
135+
# 11: end
136+
stopmode="2"
137+
138+
## Query mode
139+
# 1: session only
140+
# 2: gamedig (gsquery fallback)
141+
# 3: gamedig
142+
# 4: gsquery
143+
# 5: tcp
144+
querymode="2"
145+
querytype="protocol-valve"
146+
147+
## Console type
148+
consoleverbose="yes"
149+
consoleinteract="no"
150+
151+
## Game Server Details
152+
# Do not edit
153+
gamename="Survive the Nights"
154+
engine="unity3d"
155+
glibc="2.15"
156+
157+
#### Directories ####
158+
# Edit with care
159+
160+
## Game Server Directories
161+
systemdir="${serverfiles}"
162+
executabledir="${serverfiles}"
163+
executable="./Server_Linux_x64"
164+
servercfgdir="${systemdir}/Config"
165+
servercfg="ServerConfig.txt"
166+
servercfgdefault="ServerConfig.txt"
167+
servercfgfullpath="${servercfgdir}/${servercfg}"
168+
169+
## Backup Directory
170+
backupdir="${lgsmdir}/backup"
171+
172+
## Logging Directories
173+
logdir="${rootdir}/log"
174+
gamelogdir="${serverfiles}"
175+
lgsmlogdir="${logdir}/script"
176+
consolelogdir="${logdir}/console"
177+
gamelog="${gamelogdir}/${selfname}-game.log"
178+
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
179+
consolelog="${consolelogdir}/${selfname}-console.log"
180+
alertlog="${lgsmlogdir}/${selfname}-alert.log"
181+
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
182+
183+
## Logs Naming
184+
gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log"
185+
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
186+
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

lgsm/data/serverlist.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ sof2,sof2server,Soldier Of Fortune 2: Gold Edition
9595
sol,solserver,Soldat
9696
squad,squadserver,Squad
9797
st,stserver,Stationeers
98+
stn,stnserver,Survive the Nights
9899
sven,svenserver,Sven Co-op
99100
terraria,terrariaserver,Terraria
100101
tf2,tf2server,Team Fortress 2

lgsm/functions/info_game.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,22 @@ fn_info_game_terraria(){
16211621
fi
16221622
}
16231623

1624+
fn_info_game_stn(){
1625+
if [ -f "${servercfgfullpath}" ]; then
1626+
servername=$(sed -nr 's/^ServerName="(.*)"/\1/p' "${servercfgfullpath}")
1627+
configip=$(sed -nr 's/^ServerIP=([0-9]+)/\1/p' "${servercfgfullpath}")
1628+
port=$(sed -nr 's/^ServerPort=([0-9]+)/\1/p' "${servercfgfullpath}")
1629+
serverpassword=$(sed -nr 's/^ServerPassword=(.*)$/\1/p' "${servercfgfullpath}")
1630+
queryport=$((port + 1))
1631+
else
1632+
servername="${unavailable}"
1633+
configip=${configip:-"0.0.0.0"}
1634+
port="${zero}"
1635+
queryport="${zero}"
1636+
serverpassword=${serverpassword:-"NOT SET"}
1637+
fi
1638+
}
1639+
16241640
fn_info_game_ts3(){
16251641
if [ ! -f "${servercfgfullpath}" ]; then
16261642
dbplugin="${unavailable}"
@@ -2131,6 +2147,8 @@ elif [ "${shortname}" == "squad" ]; then
21312147
fn_info_game_squad
21322148
elif [ "${shortname}" == "st" ]; then
21332149
fn_info_game_st
2150+
elif [ "${shortname}" == "stn" ]; then
2151+
fn_info_game_stn
21342152
elif [ "${shortname}" == "terraria" ]; then
21352153
fn_info_game_terraria
21362154
elif [ "${shortname}" == "tu" ]; then

lgsm/functions/info_messages.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ fn_info_message_ports_edit(){
653653

654654
startparameterslocation="${red}UNKNOWN${default}"
655655
# engines/games that require editing in the config file.
656-
local ports_edit_array=( "ac" "arma3" "bo" "bt" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm")
656+
local ports_edit_array=( "ac" "arma3" "bo" "bt" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm")
657657
for port_edit in "${ports_edit_array[@]}"; do
658658
if [ "${shortname}" == "ut3" ]; then
659659
startparameterslocation="${servercfgdir}/UTWeb.ini"
@@ -924,6 +924,14 @@ fn_info_message_csgo(){
924924
} | column -s $'\t' -t
925925
}
926926

927+
fn_info_message_dodr(){
928+
{
929+
fn_port "header"
930+
fn_port "Game" port udp
931+
fn_port "Query" queryport udp
932+
} | column -s $'\t' -t
933+
}
934+
927935
fn_info_message_dst(){
928936
{
929937
fn_port "header"
@@ -1564,6 +1572,14 @@ fn_info_message_wurm(){
15641572
} | column -s $'\t' -t
15651573
}
15661574

1575+
fn_info_message_stn(){
1576+
{
1577+
fn_port "header"
1578+
fn_port "Game" port udp
1579+
fn_port "Query" queryport udp
1580+
} | column -s $'\t' -t
1581+
}
1582+
15671583
fn_info_message_select_engine(){
15681584
# Display details depending on game or engine.
15691585
if [ "${shortname}" == "ac" ]; then
@@ -1600,6 +1616,8 @@ fn_info_message_select_engine(){
16001616
fn_info_message_codwaw
16011617
elif [ "${shortname}" == "col" ]; then
16021618
fn_info_message_col
1619+
elif [ "${shortname}" == "dodr" ]; then
1620+
fn_info_message_dodr
16031621
elif [ "${shortname}" == "dst" ]; then
16041622
fn_info_message_dst
16051623
elif [ "${shortname}" == "eco" ]; then
@@ -1680,6 +1698,8 @@ fn_info_message_select_engine(){
16801698
fn_info_message_squad
16811699
elif [ "${shortname}" == "st" ]; then
16821700
fn_info_message_st
1701+
elif [ "${shortname}" == "stn" ]; then
1702+
fn_info_message_stn
16831703
elif [ "${shortname}" == "terraria" ]; then
16841704
fn_info_message_terraria
16851705
elif [ "${shortname}" == "ts3" ]; then

lgsm/functions/install_config.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,13 @@ elif [ "${shortname}" == "st" ]; then
723723
fn_default_config_remote
724724
fn_set_config_vars
725725
fn_list_config_locations
726+
elif [ "${shortname}" == "stn" ]; then
727+
gamedirname="SurvivetheNights"
728+
array_configs+=( ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json )
729+
fn_fetch_default_config
730+
fn_default_config_remote
731+
fn_set_config_vars
732+
fn_list_config_locations
726733
elif [ "${shortname}" == "sven" ]; then
727734
gamedirname="SvenCoop"
728735
array_configs+=( server.cfg )

0 commit comments

Comments
 (0)