Skip to content

Commit 0342ada

Browse files
authored
feat(new server): Project Cars 2 (#3842)
1 parent 60ae41d commit 0342ada

File tree

5 files changed

+230
-1
lines changed

5 files changed

+230
-1
lines changed
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
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+
## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login
12+
steamuser="username"
13+
steampass='password'
14+
15+
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
16+
startparameters="--config ${servercfg}"
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+
email="email@example.com"
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="alert@example.com"
60+
mailgunemail="email@myemail.com"
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="413770"
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="Project Cars 2"
154+
engine="madness"
155+
glibc="2.15"
156+
157+
#### Directories ####
158+
# Edit with care
159+
160+
## Game Server Directories
161+
systemdir="${serverfiles}"
162+
executabledir="${serverfiles}"
163+
executable="./DedicatedServerCmd.elf"
164+
servercfgdir="${systemdir}"
165+
servercfg="${selfname}.cfg"
166+
servercfgdefault="config_sample/server.cfg"
167+
servercfgfullpath="${servercfgdir}/${servercfg}"
168+
169+
## Backup Directory
170+
backupdir="${lgsmdir}/backup"
171+
172+
## Logging Directories
173+
logdir="${rootdir}/log"
174+
gamelogdir="${systemdir}/logs"
175+
lgsmlogdir="${logdir}/script"
176+
consolelogdir="${logdir}/console"
177+
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
178+
consolelog="${consolelogdir}/${selfname}-console.log"
179+
alertlog="${lgsmlogdir}/${selfname}-alert.log"
180+
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
181+
182+
## Logs Naming
183+
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
184+
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
@@ -72,6 +72,7 @@ ns2c,ns2cserver,NS2: Combat
7272
onset,onsetserver,Onset
7373
opfor,opforserver,Opposing Force
7474
pc,pcserver,Project Cars
75+
pc2,pc2server,Project Cars 2
7576
pmc,pmcserver,PaperMC
7677
pstbs,pstbsserver,Post Scriptum: The Bloody Seventh
7778
pvkii,pvkiiserver,Pirates Vikings & Knights II

lgsm/functions/info_game.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,33 @@ fn_info_game_pc(){
11001100
fi
11011101
}
11021102

1103+
fn_info_game_pc2(){
1104+
# Config
1105+
if [ ! -f "${servercfgfullpath}" ]; then
1106+
servername="${unavailable}"
1107+
serverpassword="${unavailable}"
1108+
maxplayers="${zero}"
1109+
port="${zero}"
1110+
queryport="${zero}"
1111+
steamport="${zero}"
1112+
else
1113+
servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
1114+
serverpassword=$(grep "password " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
1115+
maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
1116+
port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
1117+
queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
1118+
steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
1119+
1120+
# Not set
1121+
servername=${servername:-"NOT SET"}
1122+
serverpassword=${serverpassword:-"NOT SET"}
1123+
maxplayers=${maxplayers:-"NOT SET"}
1124+
port=${port:-"NOT SET"}
1125+
queryport=${queryport:-"NOT SET"}
1126+
steamport=${steamport:-"NOT SET"}
1127+
fi
1128+
}
1129+
11031130
fn_info_game_pstbs(){
11041131
# Config
11051132
if [ ! -f "${servercfgfullpath}" ]; then
@@ -2329,6 +2356,8 @@ elif [ "${shortname}" == "onset" ]; then
23292356
fn_info_game_onset
23302357
elif [ "${shortname}" == "pc" ]; then
23312358
fn_info_game_pc
2359+
elif [ "${shortname}" == "pc2" ]; then
2360+
fn_info_game_pc2
23322361
elif [ "${shortname}" == "pstbs" ]; then
23332362
fn_info_game_pstbs
23342363
elif [ "${shortname}" == "pvr" ];then

lgsm/functions/info_messages.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ fn_info_message_ports_edit(){
658658

659659
startparameterslocation="${red}UNKNOWN${default}"
660660
# engines/games that require editing in the config file.
661-
local ports_edit_array=( "ac" "arma3" "bo" "bt" "cd" "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")
661+
local ports_edit_array=( "ac" "arma3" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm")
662662
for port_edit in "${ports_edit_array[@]}"; do
663663
if [ "${shortname}" == "ut3" ]; then
664664
startparameterslocation="${servercfgdir}/UTWeb.ini"
@@ -1178,6 +1178,15 @@ fn_info_message_pc(){
11781178
} | column -s $'\t' -t
11791179
}
11801180

1181+
fn_info_message_pc2(){
1182+
{
1183+
fn_port "header"
1184+
fn_port "Game" port udp
1185+
fn_port "Query" queryport udp
1186+
fn_port "Steam" steamport udp
1187+
} | column -s $'\t' -t
1188+
}
1189+
11811190
fn_info_message_pstbs(){
11821191
{
11831192
fn_port "header"
@@ -1708,6 +1717,8 @@ fn_info_message_select_engine(){
17081717
fn_info_message_onset
17091718
elif [ "${shortname}" == "pc" ]; then
17101719
fn_info_message_pc
1720+
elif [ "${shortname}" == "pc2" ]; then
1721+
fn_info_message_pc2
17111722
elif [ "${shortname}" == "pstbs" ]; then
17121723
fn_info_message_pstbs
17131724
elif [ "${shortname}" == "pvr" ]; then

lgsm/functions/install_config.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,10 @@ elif [ "${shortname}" == "pc" ]; then
633633
fn_default_config_remote
634634
fn_set_config_vars
635635
fn_list_config_locations
636+
elif [ "${shortname}" == "pc2" ]; then
637+
gamedirname="ProjectCars2"
638+
fn_default_config_local
639+
fn_list_config_locations
636640
elif [ "${shortname}" == "q2" ]; then
637641
gamedirname="Quake2"
638642
array_configs+=( server.cfg )

0 commit comments

Comments
 (0)