Skip to content

Commit b2a1198

Browse files
committed
feat(newserver): Craftopia
1 parent b529f00 commit b2a1198

File tree

5 files changed

+230
-4
lines changed

5 files changed

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

lgsm/data/serverlist.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ cs,csserver,Counter-Strike 1.6,ubuntu-22.04
3030
cscz,csczserver,Counter-Strike: Condition Zero,ubuntu-22.04
3131
csgo,csgoserver,Counter-Strike: Global Offensive,ubuntu-22.04
3232
css,cssserver,Counter-Strike: Source,ubuntu-22.04
33+
ct,ctserver,Craftopia,ubuntu-22.04
3334
dab,dabserver,Double Action: Boogaloo,ubuntu-22.04
3435
dayz,dayzserver,DayZ,ubuntu-22.04
3536
dmc,dmcserver,Deathmatch Classic,ubuntu-22.04
@@ -128,4 +129,3 @@ wmc,wmcserver,WaterfallMC,ubuntu-22.04
128129
wurm,wurmserver,Wurm Unlimited,ubuntu-22.04
129130
zmr,zmrserver,Zombie Master: Reborn,ubuntu-22.04
130131
zps,zpsserver,Zombie Panic! Source,ubuntu-22.04
131-

lgsm/modules/info_game.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,27 @@ fn_info_game_col() {
483483
fi
484484
}
485485

486-
fn_info_game_dodr() {
486+
fn_info_game_ct(){
487+
if [ ! -f "${servercfgfullpath}" ]; then
488+
servername="${unavailable}"
489+
gamemode="${unavailable}"
490+
maxplayers="${zero}"
491+
port="${zero}"
492+
serverpasswordenabled="${unavailable}"
493+
serverpassword="${unavailable}"
494+
saveinterval="${zero}"
495+
else
496+
servername=$(sed -nr 's/^name=(.*)$/\1/p' "${servercfgfullpath}")
497+
gamemode=$(sed -nr 's/^gameMode=([0-9]+)/\1/p' "${servercfgfullpath}")
498+
port=$(sed -nr 's/^port=([0-9]+)/\1/p' "${servercfgfullpath}")
499+
maxplayers=$(sed -nr 's/^maxPlayerNumber=([0-9]+)/\1/p' "${servercfgfullpath}")
500+
serverpasswordenabled=$(sed -nr 's/^usePassword=([0-9]+)/\1/p' "${servercfgfullpath}")
501+
serverpassword=$(sed -nr 's/^serverPassword=(.*)$/\1/p' "${servercfgfullpath}")
502+
saveinterval=$(sed -nr 's/^autoSaveSec=([0-9]+)/\1/p' "${servercfgfullpath}")
503+
fi
504+
}
505+
506+
fn_info_game_dodr(){
487507
# Config
488508
if [ ! -f "${servercfgfullpath}" ]; then
489509
maxplayers="${zero}"
@@ -2409,6 +2429,8 @@ elif [ "${shortname}" == "codwaw" ]; then
24092429
fn_info_game_codwaw
24102430
elif [ "${shortname}" == "col" ]; then
24112431
fn_info_game_col
2432+
elif [ "${shortname}" == "ct" ]; then
2433+
fn_info_game_ct
24122434
elif [ "${shortname}" == "dayz" ]; then
24132435
fn_info_game_dayz
24142436
elif [ "${shortname}" == "dodr" ]; then

lgsm/modules/info_messages.sh

Lines changed: 17 additions & 2 deletions
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" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "nec" "pc" "pc2" "prism3d" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm")
666+
local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "cd" "ct" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "nec" "pc" "pc2" "prism3d" "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"
@@ -957,7 +962,15 @@ fn_info_message_csgo() {
957962
} | column -s $'\t' -t
958963
}
959964

960-
fn_info_message_dayz() {
965+
fn_info_message_ct(){
966+
fn_info_message_password_strip
967+
{
968+
fn_port "header"
969+
fn_port "Game" port udp
970+
} | column -s $'\t' -t
971+
}
972+
973+
fn_info_message_dayz(){
961974
{
962975
fn_port "header"
963976
fn_port "Game" port udp
@@ -1707,6 +1720,8 @@ fn_info_message_select_engine() {
17071720
fn_info_message_codwaw
17081721
elif [ "${shortname}" == "col" ]; then
17091722
fn_info_message_col
1723+
elif [ "${shortname}" == "ct" ]; then
1724+
fn_info_message_ct
17101725
elif [ "${shortname}" == "dayz" ]; then
17111726
fn_info_message_dayz
17121727
elif [ "${shortname}" == "dodr" ]; then

lgsm/modules/install_config.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,13 @@ elif [ "${shortname}" == "css" ]; then
381381
fn_default_config_remote
382382
fn_set_config_vars
383383
fn_list_config_locations
384+
elif [ "${shortname}" == "ct" ]; then
385+
gamedirname="Craftopia"
386+
array_configs+=( ServerSetting.ini )
387+
fn_fetch_default_config
388+
fn_default_config_remote
389+
fn_set_config_vars
390+
fn_list_config_locations
384391
elif [ "${shortname}" == "dayz" ]; then
385392
gamedirname="DayZ"
386393
fn_check_cfgdir

0 commit comments

Comments
 (0)