Skip to content

Commit 4606936

Browse files
authored
feat(fivemserver): add FiveM server (#5103)
* feat(fivemserver): add FiveM server Adds FiveM (GTA V multiplayer, Cfx.re FXServer) as fivemserver. - update_fivem.sh installs and updates the "recommended" Linux build from the Cfx.re changelog API, and tracks the installed build in a data file for check-update and update. - Install fetches the base resources from citizenfx/cfx-server-data (a tarball of the default branch) once. Updates never touch resources. - FXServer always starts with +exec server.cfg, so the bundled txAdmin web panel never starts and LinuxGSM is the only thing managing the server. - licensekey in the LinuxGSM config is passed as +set sv_licenseKey. start and debug stop with a clear message if no key is set here or in server.cfg. - Details parse server.cfg, and querying uses gamedig (gta5f). * fix(fivemserver): only pass sv_licenseKey when licensekey is set With licensekey empty, +set sv_licenseKey overrode a key set in server.cfg and would take the first extra parameter as its value. The +set is now only added when licensekey is set. Also adds extraparams and the Matrix alert settings to the default config. * feat(fivemserver): set the license key in server.cfg only Drops the licensekey LinuxGSM setting. The key now lives only in server.cfg as sv_licenseKey, so it is no longer on the command line. The start check, install message and default config point to server.cfg.
1 parent 0fb301a commit 4606936

38 files changed

Lines changed: 460 additions & 3 deletions
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
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+
11+
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
12+
## Game Server Docs | https://docs.fivem.net/docs/server-manual/setting-up-a-server-vanilla/
13+
# Ports, server name, max players and the license key (sv_licenseKey) are set in server.cfg.
14+
startparameters="+exec ${servercfg}"
15+
16+
## Extra Parameters | https://docs.linuxgsm.com/configuration/start-parameters#extra-parameters
17+
# Added to the end of startparameters.
18+
extraparams=""
19+
20+
#### LinuxGSM Settings ####
21+
22+
## LinuxGSM Stats
23+
# Send useful stats to LinuxGSM developers.
24+
# https://docs.linuxgsm.com/configuration/linuxgsm-stats
25+
# (on|off)
26+
stats="off"
27+
28+
## Notification Alerts
29+
# (on|off)
30+
31+
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
32+
displayip=""
33+
34+
# More info | https://docs.linuxgsm.com/alerts#more-info
35+
postalert="off"
36+
37+
# Alert on Start/Stop/Restart
38+
statusalert="off"
39+
40+
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
41+
discordalert="off"
42+
discordwebhook="webhook"
43+
44+
# Email Alerts | https://docs.linuxgsm.com/alerts/email
45+
emailalert="off"
46+
email="email@example.com"
47+
emailfrom=""
48+
49+
# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify
50+
gotifyalert="off"
51+
gotifytoken="token"
52+
gotifywebhook="webhook"
53+
54+
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
55+
iftttalert="off"
56+
ifttttoken="accesstoken"
57+
iftttevent="linuxgsm_alert"
58+
59+
# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy
60+
ntfyalert="off"
61+
ntfytopic="LinuxGSM"
62+
ntfyserver="https://ntfy.sh"
63+
ntfytoken=""
64+
ntfyusername=""
65+
ntfypassword=""
66+
ntfypriority=""
67+
ntfytags=""
68+
69+
# Matrix Alerts | https://docs.linuxgsm.com/alerts/matrix
70+
matrixalert="off"
71+
matrixhomeserver="matrix.org"
72+
matrixtoken="accesstoken"
73+
matrixroom=""
74+
75+
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
76+
pushbulletalert="off"
77+
pushbullettoken="accesstoken"
78+
channeltag=""
79+
80+
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
81+
pushoveralert="off"
82+
pushovertoken="accesstoken"
83+
pushoveruserkey="userkey"
84+
85+
# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
86+
rocketchatalert="off"
87+
rocketchatwebhook="webhook"
88+
89+
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
90+
slackalert="off"
91+
slackwebhook="webhook"
92+
93+
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
94+
# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring".
95+
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help all".
96+
telegramapi="api.telegram.org"
97+
telegramalert="off"
98+
telegramtoken="accesstoken"
99+
telegramchatid=""
100+
telegramthreadid=""
101+
telegramsilentnotification="false"
102+
curlcustomstring=""
103+
104+
## Stop | https://docs.linuxgsm.com/commands/start-stop-restart
105+
stoponlyifnoplayers="off"
106+
stoponlyifnoplayersallcommands="on"
107+
108+
## Player Warnings | https://docs.linuxgsm.com/features/player-warnings
109+
# Minutes to warn players in-game before a stop, restart or update. 0 to disable.
110+
# e.g. 15 warns at 15, 10, 5, 3 and 1 minutes.
111+
warnplayerstimer="0"
112+
113+
## Updating | https://docs.linuxgsm.com/commands/update
114+
updateonstart="off"
115+
116+
## Backup | https://docs.linuxgsm.com/commands/backup
117+
maxbackups="4"
118+
maxbackupdays="30"
119+
stoponbackup="on"
120+
121+
## Logging | https://docs.linuxgsm.com/features/logging
122+
consolelogging="on"
123+
logdays="7"
124+
125+
## Monitor | https://docs.linuxgsm.com/commands/monitor
126+
# Query delay time
127+
querydelay="5"
128+
129+
## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
130+
ansi="on"
131+
132+
#### Advanced Settings ####
133+
134+
## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
135+
sleeptime="0.5"
136+
137+
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
138+
# 1: tmux kill
139+
# 2: CTRL+c
140+
# 3: quit
141+
# 4: quit 120s
142+
# 5: stop
143+
# 6: q
144+
# 7: exit
145+
# 8: 7 Days to Die
146+
# 9: GoldSrc
147+
# 10: Avorion
148+
# 11: end
149+
# 12: shutdown
150+
# 13: soulmask
151+
# 14: Running With Rifles
152+
# 15: Rising World
153+
# 16: Conan Exiles
154+
stopmode="3"
155+
156+
## Query mode
157+
# 1: session only
158+
# 2: gamedig (gsquery fallback)
159+
# 3: gamedig
160+
# 4: gsquery
161+
# 5: tcp
162+
querymode="3"
163+
querytype="gta5f"
164+
165+
## Console type
166+
consoleverbose="yes"
167+
consoleinteract="yes"
168+
169+
## Game Server Details
170+
# Do not edit
171+
gamename="FiveM"
172+
engine="cfx"
173+
glibc="null"
174+
175+
#### Directories ####
176+
# Edit with care
177+
178+
## Game Server Directories
179+
systemdir="${serverfiles}"
180+
executabledir="${serverfiles}"
181+
executable="./run.sh"
182+
servercfgdir="${systemdir}"
183+
servercfg="server.cfg"
184+
servercfgdefault="server.cfg"
185+
servercfgfullpath="${servercfgdir}/${servercfg}"
186+
187+
## Backup Directory
188+
backupdir="${lgsmdir}/backup"
189+
190+
## Logging Directories
191+
[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log"
192+
lgsmlogdir="${logdir}/script"
193+
consolelogdir="${logdir}/console"
194+
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
195+
consolelog="${consolelogdir}/${selfname}-console.log"
196+
alertlog="${lgsmlogdir}/${selfname}-alert.log"
197+
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
198+
199+
## Logs Naming
200+
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
201+
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"
202+
203+
## Log Parameters
204+
logtimestamp="off"
205+
logtimestampformat="%Y-%m-%d %H:%M:%S"

‎lgsm/data/almalinux-8.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ em
5050
etl
5151
ets2,libatomic
5252
fctr
53+
fivem
5354
fof
5455
gmod,ncurses-libs.i686
5556
hcu

‎lgsm/data/almalinux-9.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ em
5050
etl
5151
ets2,libatomic
5252
fctr
53+
fivem
5354
fof
5455
gmod,ncurses-libs.i686
5556
hcu

‎lgsm/data/centos-7.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ em
5050
etl
5151
ets2,libatomic
5252
fctr
53+
fivem
5354
fof
5455
gmod,ncurses-libs.i686
5556
hcu

‎lgsm/data/centos-8.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ em
5050
etl
5151
ets2,libatomic
5252
fctr
53+
fivem
5354
fof
5455
gmod,ncurses-libs.i686
5556
hcu

‎lgsm/data/centos-9.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ em
5050
etl
5151
ets2,libatomic
5252
fctr
53+
fivem
5354
fof
5455
gmod,ncurses-libs.i686
5556
hcu

‎lgsm/data/debian-10.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ em
4949
etl
5050
ets2,libatomic1
5151
fctr
52+
fivem
5253
fof
5354
gmod,libtinfo5:i386
5455
hcu

‎lgsm/data/debian-11.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ em
5050
etl
5151
ets2,libatomic1
5252
fctr
53+
fivem
5354
fof
5455
gmod,libtinfo5:i386
5556
hcu

‎lgsm/data/debian-12.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ em
5050
etl
5151
ets2,libatomic1
5252
fctr
53+
fivem
5354
fof
5455
gmod,libtinfo5:i386
5556
hcu

‎lgsm/data/debian-13.csv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ em
5050
etl
5151
ets2,libatomic1
5252
fctr
53+
fivem
5354
fof
5455
gmod
5556
hcu

0 commit comments

Comments
 (0)