Browse Source

added minecraft server config

feature/startup-from-labels
Mario Alegre 5 years ago
parent
commit
1f45444e1f
  1. 3
      src/minecraft_be/Containerfile
  2. 25
      src/minecraft_be/assets/bin/mcbe-backup
  3. 6
      src/minecraft_be/assets/minecraft/permissions.json
  4. 97
      src/minecraft_be/assets/minecraft/server.properties
  5. 11
      src/minecraft_be/assets/minecraft/whitelist.json

3
src/minecraft_be/Containerfile

@ -41,6 +41,9 @@ RUN url=$(wget -q https://www.minecraft.net/en-us/download/server/bedrock/ -O -
rm $(basename $url) && \
chown -R mcadmin:mcadmin ./
# copy minecraft config
COPY chown=mcadmin:mcadmin assets/minecraft/ /home/mcadmin/
# copy units to systemd
COPY assets/systemd/ /etc/systemd/system/

25
src/minecraft_be/assets/bin/mcbe-backup

@ -1,34 +1,34 @@
#!/bin/bash
do_backup() {
mcbe-stop $1 "Shutting down server for scheduled daily backup."
rsyn /home/mcadmin/worlds/ /vol/worlds/
systemctl start mcbe
rm /home/mcadmin/backup.lock
mcbe-stop $1 "Shutting down server for scheduled daily backup."
rsyn /home/mcadmin/worlds/ /vol/worlds/
systemctl start mcbe
rm /home/mcadmin/backup.attempts
}
# Check if server is started
status=$(systemctl show "$service" -p ActiveState --value)
# if service is not active, do backup immediately and exit
if [[ $status == inactive ]]; then
rsyn /home/mcadmin/worlds/ /vol/worlds/
rm /home/mcadmin/backup.lock
exit 0
rsyn /home/mcadmin/worlds/ /vol/worlds/
rm /home/mcadmin/backup.attempts
exit 0
fi
# Check if any players present
present=$(mcbe-exec list | cut -d ' ' -f 3 | cut -d '/' -f 1)
# if no players are present, do backup immediately and exit
if [[ $present == 0 ]]; then
do_backup 0
exit 0
do_backup 0
exit 0
fi
cd /home/mcadmin
# create backup.attempts file if it doesn't exist
if [[ ! -e backup.attempts ]]; then
echo "0" > backup.attempts
echo "0" > backup.attempts
fi
# read backup.wait and add one to it
@ -36,8 +36,9 @@ attempts=$(( $(cat backup.attempts) + 1 ))
# if 12 or more attempts have already been made, go ahead and force a shutdown anyways
if [[ $attempts -ge 12 ]]; then
do_backup 10
do_backup 10
# otherwise, schedule another attempt in an hour
else
systemd-run --on-active=1h $0
echo $attempts > backup.attempts
systemd-run --on-active=1h $0
fi

6
src/minecraft_be/assets/minecraft/permissions.json

@ -0,0 +1,6 @@
[
{
"permission" : "operator",
"xuid" : "2535473403284928"
}
]

97
src/minecraft_be/assets/minecraft/server.properties

@ -0,0 +1,97 @@
server-name=Living Lightning Server
# Used as the server name
# Allowed values: Any string
gamemode=survival
# Sets the game mode for new players.
# Allowed values: "survival", "creative", or "adventure"
difficulty=hard
# Sets the difficulty of the world.
# Allowed values: "peaceful", "easy", "normal", or "hard"
allow-cheats=false
# If true then cheats like commands can be used.
# Allowed values: "true" or "false"
max-players=10
# The maximum number of players that can play on the server.
# Allowed values: Any positive integer
online-mode=true
# If true then all connected players must be authenticated to Xbox Live.
# Clients connecting to remote (non-LAN) servers will always require Xbox Live authentication regardless of this setting.
# If the server accepts connections from the Internet, then it's highly recommended to enable online-mode.
# Allowed values: "true" or "false"
white-list=true
# If true then all connected players must be listed in the separate whitelist.json file.
# Allowed values: "true" or "false"
server-port=19132
# Which IPv4 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]
server-portv6=19133
# Which IPv6 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]
view-distance=80
# The maximum allowed view distance in number of chunks.
# Allowed values: Any positive integer.
tick-distance=8
# The world will be ticked this many chunks away from any player.
# Allowed values: Integers in the range [4, 12]
player-idle-timeout=30
# After a player has idled for this many minutes they will be kicked. If set to 0 then players can idle indefinitely.
# Allowed values: Any non-negative integer.
max-threads=8
# Maximum number of threads the server will try to use. If set to 0 or removed then it will use as many as possible.
# Allowed values: Any positive integer.
level-name=Default level
# Allowed values: Any string
level-seed=
# Use to randomize the world
# Allowed values: Any string
default-player-permission-level=member
# Permission level for new players joining for the first time.
# Allowed values: "visitor", "member", "operator"
texturepack-required=false
# Force clients to use texture packs in the current world
# Allowed values: "true" or "false"
content-log-file-enabled=false
# Enables logging content errors to a file
# Allowed values: "true" or "false"
compression-threshold=1
# Determines the smallest size of raw network payload to compress
# Allowed values: 0-65535
server-authoritative-movement=true
# Enables server authoritative movement. If true, the server will replay local user input on
# the server and send down corrections when the client's position doesn't match the server's.
# Corrections will only happen if correct-player-movement is set to true.
player-movement-score-threshold=20
# The number of incongruent time intervals needed before abnormal behavior is reported.
# Disabled by server-authoritative-movement.
player-movement-distance-threshold=0.3
# The difference between server and client positions that needs to be exceeded before abnormal behavior is detected.
# Disabled by server-authoritative-movement.
player-movement-duration-threshold-in-ms=500
# The duration of time the server and client positions can be out of sync (as defined by player-movement-distance-threshold)
# before the abnormal movement score is incremented. This value is defined in milliseconds.
# Disabled by server-authoritative-movement.
correct-player-movement=false
# If true, the client position will get corrected to the server position if the movement score exceeds the threshold.

11
src/minecraft_be/assets/minecraft/whitelist.json

@ -0,0 +1,11 @@
[
{
"ignoresPlayerLimit":false,
"name":"MarVel0z",
"xuid":"2535473403284928"
},
{
"ignoresPlayerLimit":false,
"name":"BISONMEATS"
}
]
Loading…
Cancel
Save