diff --git a/README.md b/README.md index 779519f..59b5400 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,14 @@ in the "LAN Games" part of the "Friends" tab, such as: ![](docs/example-client.jpg) +## Whitelist + +The whitelist works with player names. The server will look up the names and add in the XUID to match the player. + +```shell +-e WHITELIST "player1,player2,player3" +``` + ## More information For more information about managing Bedrock Dedicated Servers in general, [check out this Reddit post](https://old.reddit.com/user/ProfessorValko/comments/9f438p/bedrock_dedicated_server_tutorial/). diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 7c4342d..1d28d64 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -94,6 +94,14 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then mv bedrock_server bedrock_server-${VERSION} fi +if [ -n "$WHITE_LIST" ]; then + echo "Setting whitelist" + rm -rf whitelist.json + echo $WHITE_LIST | awk -v RS=, 'BEGIN{print "["}; {print "{ \"name\": \"" $1 "\" },"}; END{print "]"}' > whitelist.json + # flag whitelist to true so the server properties process correctly + export WHITE_LIST=true +fi + set-property --file server.properties --bulk /etc/bds-property-definitions.json export LD_LIBRARY_PATH=.