Skip to content

Commit 8647857

Browse files
authored
feat(newserver): Minecraft Bedrock (#2626)
1 parent 75c3238 commit 8647857

File tree

16 files changed

+418
-7
lines changed

16 files changed

+418
-7
lines changed
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
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 Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
12+
fn_parms(){
13+
parms=""
14+
}
15+
16+
#### LinuxGSM Settings ####
17+
18+
## LinuxGSM Stats
19+
# Send useful stats to LinuxGSM developers.
20+
# https://docs.linuxgsm.com/configuration/linuxgsm-stats
21+
# (on|off)
22+
stats="off"
23+
24+
## Notification Alerts
25+
# (on|off)
26+
27+
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
28+
displayip=""
29+
30+
# More info | https://docs.linuxgsm.com/alerts#more-info
31+
postalert="off"
32+
postdays="7"
33+
posttarget="https://hastebin.com"
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+
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
45+
iftttalert="off"
46+
ifttttoken="accesstoken"
47+
iftttevent="linuxgsm_alert"
48+
49+
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
50+
mailgunalert="off"
51+
mailguntoken="accesstoken"
52+
mailgundomain="example.com"
53+
mailgunemailfrom="[email protected]"
54+
mailgunemail="[email protected]"
55+
56+
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
57+
pushbulletalert="off"
58+
pushbullettoken="accesstoken"
59+
channeltag=""
60+
61+
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
62+
pushoveralert="off"
63+
pushovertoken="accesstoken"
64+
65+
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
66+
slackalert="off"
67+
slackwebhook="webhook"
68+
69+
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
70+
# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
71+
# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
72+
# any custom string in curl - simple ignore this parameter.
73+
telegramalert="off"
74+
telegramtoken="accesstoken"
75+
telegramchatid=""
76+
curlcustomstring=""
77+
78+
## Updating | https://docs.linuxgsm.com/commands/update
79+
updateonstart="off"
80+
81+
## Backup | https://docs.linuxgsm.com/commands/backup
82+
maxbackups="4"
83+
maxbackupdays="30"
84+
stoponbackup="on"
85+
86+
## Logging | https://docs.linuxgsm.com/features/logging
87+
consolelogging="on"
88+
logdays="7"
89+
90+
## Monitor | https://docs.linuxgsm.com/commands/monitor
91+
# Query delay time
92+
querydelay="1"
93+
94+
## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
95+
ansi="on"
96+
97+
#### Advanced Settings ####
98+
99+
## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
100+
sleeptime="0.5"
101+
102+
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
103+
# 1: tmux kill
104+
# 2: CTRL+c
105+
# 3: quit
106+
# 4: quit 120s
107+
# 5: stop
108+
# 6: q
109+
# 7: exit
110+
# 8: 7 Days to Die
111+
# 9: Gold Source
112+
# 10: Teamspeak 3
113+
stopmode="5"
114+
115+
## Query mode
116+
# 1: session only
117+
# 2: gamedig + gsquery
118+
# 3: gamedig
119+
# 4: gsquery
120+
# 5: tcp
121+
querymode="4"
122+
querytype="minecraftbe"
123+
124+
## Game Server Details
125+
# Do not edit
126+
gamename="Minecraft Bedrock"
127+
engine="bedrock"
128+
glibc="2.27"
129+
130+
#### Directories ####
131+
# Edit with care
132+
133+
## Game Server Directories
134+
systemdir="${serverfiles}"
135+
executabledir="${serverfiles}"
136+
executable="${serverfiles}/bedrock_server"
137+
servercfg="server.properties"
138+
servercfgdefault="server.properties"
139+
servercfgdir="${serverfiles}"
140+
servercfgfullpath="${servercfgdir}/${servercfg}"
141+
142+
## Backup Directory
143+
backupdir="${lgsmdir}/backup"
144+
145+
## Logging Directories
146+
logdir="${rootdir}/log"
147+
gamelogdir="${systemdir}"
148+
lgsmlogdir="${logdir}/script"
149+
consolelogdir="${logdir}/console"
150+
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
151+
consolelog="${consolelogdir}/${selfname}-console.log"
152+
alertlog="${lgsmlogdir}/${selfname}-alert.log"
153+
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
154+
155+
## Logs Naming
156+
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
157+
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ javaram="1024" # -Xmx$1024M
1515
fn_parms(){
1616
parms="nogui"
1717
}
18+
1819
#### LinuxGSM Settings ####
1920

2021
## LinuxGSM Stats

lgsm/data/serverlist.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ kf2,kf2server,Killing Floor 2
4949
l4d,l4dserver,Left 4 Dead
5050
l4d2,l4d2server,Left 4 Dead 2
5151
mc,mcserver,Minecraft
52+
mcb,mcbserver,Minecraft Bedrock
5253
mh,mhserver,MORDHAU
5354
mohaa,mohaaserver,Medal of Honor: Allied Assault
5455
mta,mtaserver,Multi Theft Auto

lgsm/functions/command_monitor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn_monitor_check_lockfile(){
1717
fn_print_checking_eol
1818
fn_script_log_info "Checking lockfile: CHECKING"
1919
fn_sleep_time
20-
fn_print_error_nl "Checking lockfile: No lockfile found: "
20+
fn_print_error "Checking lockfile: No lockfile found: "
2121
fn_print_error_eol
2222
fn_script_log_error "Checking lockfile: No lockfile found: ERROR"
2323
fn_sleep_time

lgsm/functions/command_update.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ if [ "${shortname}" == "ts3" ]; then
1616
update_ts3.sh
1717
elif [ "${shortname}" == "mc" ]; then
1818
update_minecraft.sh
19+
elif [ "${shortname}" == "mcb" ]; then
20+
update_minecraft_bedrock.sh
1921
elif [ "${shortname}" == "mumble" ]; then
2022
update_mumble.sh
2123
elif [ "${shortname}" == "fctr" ]; then

lgsm/functions/core_dl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn_dl_extract(){
8181
elif [ "${mime}" == "application/x-xz" ]; then
8282
tarcmd=$(tar -xf "${local_filedir}/${local_filename}" -C "${extractdir}")
8383
elif [ "${mime}" == "application/zip" ]; then
84-
extractcmd=$(unzip -d "${extractdir}" "${local_filedir}/${local_filename}")
84+
extractcmd=$(unzip -dq "${extractdir}" "${local_filedir}/${local_filename}")
8585
fi
8686
local exitcode=$?
8787
if [ ${exitcode} -ne 0 ]; then

lgsm/functions/core_functions.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,11 @@ functionfile="${FUNCNAME[0]}"
331331
fn_fetch_function
332332
}
333333

334+
fix_mcb.sh(){
335+
functionfile="${FUNCNAME[0]}"
336+
fn_fetch_function
337+
}
338+
334339
fix_mta.sh(){
335340
functionfile="${FUNCNAME[0]}"
336341
fn_fetch_function
@@ -545,6 +550,11 @@ functionfile="${FUNCNAME[0]}"
545550
fn_fetch_function
546551
}
547552

553+
update_minecraft_bedrock.sh(){
554+
functionfile="${FUNCNAME[0]}"
555+
fn_fetch_function
556+
}
557+
548558
update_mumble.sh(){
549559
functionfile="${FUNCNAME[0]}"
550560
fn_fetch_function

lgsm/functions/fix.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th
6767
fix_terraria.sh
6868
elif [ "${shortname}" == "ts3" ]; then
6969
fix_ts3.sh
70+
elif [ "${shortname}" == "mcb" ]; then
71+
fix_mcb.sh
7072
elif [ "${shortname}" == "mta" ]; then
7173
fix_mta.sh
7274
elif [ "${shortname}" == "unt" ]; then

lgsm/functions/fix_mcb.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
# LinuxGSM fix_mcb.sh function
3+
# Author: Daniel Gibbs
4+
# Website: https://linuxgsm.com
5+
# Description: Resolves possible startup issue with Minecraft Bedrock
6+
7+
local commandname="FIX"
8+
local commandaction="Fix"
9+
10+
# official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server
11+
export LD_LIBRARY_PATH="${serverfiles}:$LD_LIBRARY_PATH"

lgsm/functions/info_config.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,35 @@ fn_info_config_minecraft(){
386386
fi
387387
}
388388

389+
fn_info_config_minecraft_bedrock(){
390+
if [ ! -f "${servercfgfullpath}" ]; then
391+
servername="${unavailable}"
392+
maxplayers="${zero}"
393+
port="${zero}"
394+
port6="${zero}"
395+
queryport="${zero}"
396+
gamemode="${unavailable}"
397+
gameworld="${unavailable}"
398+
else
399+
servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
400+
maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
401+
port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
402+
port6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]')
403+
queryport=${port}
404+
gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
405+
gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
406+
407+
# Not Set
408+
servername=${servername:-"NOT SET"}
409+
maxplayers=${maxplayers:-"NOT SET"}
410+
port=${port:-"NOT SET"}
411+
port6=${port6:-"NOT SET"}
412+
queryport=${queryport:-"NOT SET"}
413+
gamemode=${gamemode:-"NOT SET"}
414+
gameworld=${gameworld:-"NOT SET"}
415+
fi
416+
}
417+
389418
fn_info_config_mohaa(){
390419
if [ ! -f "${servercfgfullpath}" ]; then
391420
rconpassword="${unavailable}"
@@ -1364,6 +1393,9 @@ elif [ "${shortname}" == "ql" ]; then
13641393
# Minecraft
13651394
elif [ "${shortname}" == "mc" ]; then
13661395
fn_info_config_minecraft
1396+
# Minecraft Bedrock
1397+
elif [ "${shortname}" == "mcb" ]; then
1398+
fn_info_config_minecraft_bedrock
13671399
# Post Scriptum: The Bloody Seventh
13681400
elif [ "${shortname}" == "pstbs" ]; then
13691401
fn_info_config_pstbs

0 commit comments

Comments
 (0)