Skip to content

Commit 5e4d98b

Browse files
committed
feat(newserver): Craftopia
1 parent 1a022ca commit 5e4d98b

File tree

6 files changed

+259
-1
lines changed

6 files changed

+259
-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+
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
12+
# Edit with care | https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29
13+
startparameters="-batchmode -showlogs"
14+
15+
#### LinuxGSM Settings ####
16+
17+
## LinuxGSM Stats
18+
# Send useful stats to LinuxGSM developers.
19+
# https://docs.linuxgsm.com/configuration/linuxgsm-stats
20+
# (on|off)
21+
stats="off"
22+
23+
## Notification Alerts
24+
# (on|off)
25+
26+
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
27+
displayip=""
28+
29+
# More info | https://docs.linuxgsm.com/alerts#more-info
30+
postalert="off"
31+
32+
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
33+
discordalert="off"
34+
discordwebhook="webhook"
35+
36+
# Email Alerts | https://docs.linuxgsm.com/alerts/email
37+
emailalert="off"
38+
39+
emailfrom=""
40+
41+
# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify
42+
gotifyalert="off"
43+
gotifytoken="token"
44+
gotifywebhook="webhook"
45+
46+
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
47+
iftttalert="off"
48+
ifttttoken="accesstoken"
49+
iftttevent="linuxgsm_alert"
50+
51+
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
52+
mailgunalert="off"
53+
mailgunapiregion="us"
54+
mailguntoken="accesstoken"
55+
mailgundomain="example.com"
56+
mailgunemailfrom="[email protected]"
57+
mailgunemail="[email protected]"
58+
59+
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
60+
pushbulletalert="off"
61+
pushbullettoken="accesstoken"
62+
channeltag=""
63+
64+
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
65+
pushoveralert="off"
66+
pushovertoken="accesstoken"
67+
pushoveruserkey="userkey"
68+
69+
# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
70+
rocketchatalert="off"
71+
rocketchatwebhook="webhook"
72+
rocketchattoken=""
73+
74+
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
75+
slackalert="off"
76+
slackwebhook="webhook"
77+
78+
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
79+
# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring".
80+
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help".
81+
telegramapi="api.telegram.org"
82+
telegramalert="off"
83+
telegramtoken="accesstoken"
84+
telegramchatid=""
85+
curlcustomstring=""
86+
87+
## Updating | https://docs.linuxgsm.com/commands/update
88+
updateonstart="off"
89+
90+
## Backup | https://docs.linuxgsm.com/commands/backup
91+
maxbackups="4"
92+
maxbackupdays="30"
93+
stoponbackup="on"
94+
95+
## Logging | https://docs.linuxgsm.com/features/logging
96+
consolelogging="on"
97+
logdays="7"
98+
99+
## Monitor | https://docs.linuxgsm.com/commands/monitor
100+
# Query delay time
101+
querydelay="1"
102+
103+
## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
104+
ansi="on"
105+
106+
#### Advanced Settings ####
107+
108+
## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
109+
sleeptime="0.5"
110+
111+
## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd
112+
# Server appid
113+
appid="1670340"
114+
steamcmdforcewindows="no"
115+
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
116+
branch=""
117+
betapassword=""
118+
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
119+
steammaster="false"
120+
121+
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
122+
# 1: tmux kill
123+
# 2: CTRL+c
124+
# 3: quit
125+
# 4: quit 120s
126+
# 5: stop
127+
# 6: q
128+
# 7: exit
129+
# 8: 7 Days to Die
130+
# 9: GoldSrc
131+
# 10: Avorion
132+
# 11: end
133+
# 12: Craftopia
134+
stopmode="12"
135+
136+
## Query mode
137+
# 1: session only
138+
# 2: gamedig (gsquery fallback)
139+
# 3: gamedig
140+
# 4: gsquery
141+
# 5: tcp
142+
querymode="1"
143+
querytype=""
144+
145+
## Console type
146+
consoleverbose="no"
147+
consoleinteract="yes"
148+
149+
## Game Server Details
150+
# Do not edit
151+
gamename="Craftopia"
152+
engine="unity3d"
153+
glibc="2.17"
154+
155+
#### Directories ####
156+
# Edit with care
157+
158+
## Game Server Directories
159+
systemdir="${serverfiles}"
160+
executabledir="${serverfiles}"
161+
executable="./Craftopia.x86_64"
162+
servercfgdir="${systemdir}"
163+
servercfg="ServerSetting.ini"
164+
servercfgdefault="ServerSetting.ini"
165+
servercfgfullpath="${servercfgdir}/${servercfg}"
166+
167+
## Backup Directory
168+
backupdir="${lgsmdir}/backup"
169+
170+
## Logging Directories
171+
logdir="${rootdir}/log"
172+
#gamelogdir="${serverfiles}"
173+
lgsmlogdir="${logdir}/script"
174+
consolelogdir="${logdir}/console"
175+
gamelog="${gamelogdir}/${selfname}-game.log"
176+
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
177+
consolelog="${consolelogdir}/${selfname}-console.log"
178+
alertlog="${lgsmlogdir}/${selfname}-alert.log"
179+
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
180+
181+
## Logs Naming
182+
gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log"
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
@@ -27,6 +27,7 @@ cs,csserver,Counter-Strike 1.6
2727
cscz,csczserver,Counter-Strike: Condition Zero
2828
csgo,csgoserver,Counter-Strike: Global Offensive
2929
css,cssserver,Counter-Strike: Source
30+
ct,ctserver,Craftopia
3031
dab,dabserver,Double Action: Boogaloo
3132
dayz,dayzserver,DayZ
3233
dmc,dmcserver,Deathmatch Classic

lgsm/functions/command_stop.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,33 @@ fn_stop_graceful_avorion(){
208208
fi
209209
}
210210

211+
fn_stop_graceful_ct(){
212+
fn_print_dots "Graceful: quit, yes"
213+
fn_script_log_info "Graceful: quit, yes"
214+
# send first quit
215+
tmux send-keys -t "${sessionname}" quit ENTER > /dev/null 2>&1
216+
sleep 2
217+
# send yes to confirm the shutdown
218+
tmux send-keys -t "${sessionname}" yes ENTER > /dev/null 2>&1
219+
for seconds in {1..30}; do
220+
check_status.sh
221+
if [ "${status}" == "0" ]; then
222+
fn_print_ok "Graceful: quit, yes"
223+
fn_print_ok_eol_nl
224+
fn_script_log_pass "Graceful: quit, yes"
225+
break
226+
fi
227+
sleep 1
228+
fn_print_dots "Graceful: quit, yes"
229+
done
230+
check_status.sh
231+
if [ "${status}" != "0" ]; then
232+
fn_print_error "Graceful: quit, yes"
233+
fn_print_fail_eol_nl
234+
fn_script_log_error "Graceful: quit, yes FAIL"
235+
fi
236+
}
237+
211238
fn_stop_graceful_select(){
212239
if [ "${stopmode}" == "1" ]; then
213240
fn_stop_tmux
@@ -231,6 +258,8 @@ fn_stop_graceful_select(){
231258
fn_stop_graceful_avorion
232259
elif [ "${stopmode}" == "11" ]; then
233260
fn_stop_graceful_cmd "end" 30
261+
elif [ "${stopmode}" == "12" ]; then
262+
fn_stop_graceful_ct
234263
fi
235264
}
236265

lgsm/functions/info_game.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,26 @@ fn_info_game_col(){
445445
fi
446446
}
447447

448+
fn_info_game_ct(){
449+
if [ ! -f "${servercfgfullpath}" ]; then
450+
servername="${unavailable}"
451+
gamemode="${unavailable}"
452+
maxplayers="${zero}"
453+
port="${zero}"
454+
serverpasswordenabled="${unavailable}"
455+
serverpassword="${unavailable}"
456+
saveinterval="${zero}"
457+
else
458+
servername=$(sed -nr 's/^name=(.*)$/\1/p' "${servercfgfullpath}")
459+
gamemode=$(sed -nr 's/^gameMode=([0-9]+)/\1/p' "${servercfgfullpath}")
460+
port=$(sed -nr 's/^port=([0-9]+)/\1/p' "${servercfgfullpath}")
461+
maxplayers=$(sed -nr 's/^maxPlayerNumber=([0-9]+)/\1/p' "${servercfgfullpath}")
462+
serverpasswordenabled=$(sed -nr 's/^usePassword=([0-9]+)/\1/p' "${servercfgfullpath}")
463+
serverpassword=$(sed -nr 's/^serverPassword=(.*)$/\1/p' "${servercfgfullpath}")
464+
saveinterval=$(sed -nr 's/^autoSaveSec=([0-9]+)/\1/p' "${servercfgfullpath}")
465+
fi
466+
}
467+
448468
fn_info_game_dodr(){
449469
# Config
450470
if [ ! -f "${servercfgfullpath}" ]; then
@@ -2283,6 +2303,8 @@ elif [ "${shortname}" == "codwaw" ]; then
22832303
fn_info_game_codwaw
22842304
elif [ "${shortname}" == "col" ]; then
22852305
fn_info_game_col
2306+
elif [ "${shortname}" == "ct" ]; then
2307+
fn_info_game_ct
22862308
elif [ "${shortname}" == "dayz" ]; then
22872309
fn_info_game_dayz
22882310
elif [ "${shortname}" == "dodr" ]; then

lgsm/functions/info_messages.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ fn_info_message_gameserver(){
285285
echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}"
286286
fi
287287

288+
# Server password enabled (Craftopia)
289+
if [ -n "${serverpasswordenabled}" ]; then
290+
echo -e "${lightblue}Server password enabled:\t${default}${serverpasswordenabled}"
291+
fi
292+
288293
# Server password
289294
if [ -n "${serverpassword}" ]; then
290295
echo -e "${lightblue}Server password:\t${default}${serverpassword}"
@@ -658,7 +663,7 @@ fn_info_message_ports_edit(){
658663

659664
startparameterslocation="${red}UNKNOWN${default}"
660665
# 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")
666+
local ports_edit_array=( "ac" "arma3" "bo" "bt" "cd" "ct" "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")
662667
for port_edit in "${ports_edit_array[@]}"; do
663668
if [ "${shortname}" == "ut3" ]; then
664669
startparameterslocation="${servercfgdir}/UTWeb.ini"
@@ -938,6 +943,14 @@ fn_info_message_csgo(){
938943
} | column -s $'\t' -t
939944
}
940945

946+
fn_info_message_ct(){
947+
fn_info_message_password_strip
948+
{
949+
fn_port "header"
950+
fn_port "Game" port udp
951+
} | column -s $'\t' -t
952+
}
953+
941954
fn_info_message_dayz(){
942955
{
943956
fn_port "header"
@@ -1660,6 +1673,8 @@ fn_info_message_select_engine(){
16601673
fn_info_message_codwaw
16611674
elif [ "${shortname}" == "col" ]; then
16621675
fn_info_message_col
1676+
elif [ "${shortname}" == "ct" ]; then
1677+
fn_info_message_ct
16631678
elif [ "${shortname}" == "dayz" ]; then
16641679
fn_info_message_dayz
16651680
elif [ "${shortname}" == "dodr" ]; then

lgsm/functions/install_config.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,13 @@ elif [ "${shortname}" == "css" ]; then
358358
fn_default_config_remote
359359
fn_set_config_vars
360360
fn_list_config_locations
361+
elif [ "${shortname}" == "ct" ]; then
362+
gamedirname="Craftopia"
363+
array_configs+=( ServerSetting.ini )
364+
fn_fetch_default_config
365+
fn_default_config_remote
366+
fn_set_config_vars
367+
fn_list_config_locations
361368
elif [ "${shortname}" == "dayz" ]; then
362369
gamedirname="DayZ"
363370
fn_check_cfgdir

0 commit comments

Comments
 (0)