From 9cece17804b28e0d488894c2956f91071aa0336a Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt <2270806+jammsen@users.noreply.github.com> Date: Fri, 19 Jan 2024 18:48:08 +0100 Subject: [PATCH] partial fix part four --- Dockerfile | 4 +--- README.md | 3 +-- docker-compose.yml | 2 -- servermanager.sh | 11 +++++++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58541f0..bf4124c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,9 @@ ENV TIMEZONE=Europe/Berlin \ ALWAYS_UPDATE_ON_START=false \ GAME_PORT=8211 \ MAX_PLAYERS=16 \ - SERVER_NAME="jammsen-docker-generated" \ - SERVER_PASSWORD="test" \ MULTITHREAD_ENABLED=true \ COMMUNITY_SERVER=true \ - PUBLIC_IP=10.0.0.5 \ + PUBLIC_IP=10.0.0.1 \ PUBLIC_PORT=8211 VOLUME [ "/palworld" ] diff --git a/README.md b/README.md index 1dda25a..94a9255 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ This includes a Palworld Dedicated Server based on Linux and Docker. 1. Create `game` sub-directories on your Dockernode in your game-server-directory (`/srv/palworld`) and give it with `chmod 777 game` full permissions. 2. Setup Port-Forwarding or NAT for the ports in the Docker-Compose file 3. (Build if needed )Start via `docker-compose up -d` - See docker-compose.yml and next section for more infos +4. After first start, stop the server, setup your config at `game/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini` and start it again ## Environment-Variables | Variable | Describe | Default Value | Allowed Value | @@ -36,8 +37,6 @@ This includes a Palworld Dedicated Server based on Linux and Docker. | ALWAYS_UPDATE_ON_START | Updates the server on startup | true | false/true | | GAME_PORT | Game port of the server | 8211 | 1024-65535 | | MAX_PLAYERS | Maximum amout of players | 32 | 1-32 | -| SERVER_NAME | Name of the server | | string | -| SERVER_PASSWORD | Password of the server | | string | | MULTITHREAD_ENABLED | Sets options for "Improved multi-threaded CPU performance" | true | false/true | | COMMUNITY_SERVER | Sets the server to a "Community-Server", will appear in the list | false | false/true | | PUBLIC_IP | Public ip, auto-detect if not specified | false | ip address | diff --git a/docker-compose.yml b/docker-compose.yml index 0aa8d5e..e7b277a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,8 +12,6 @@ services: - ALWAYS_UPDATE_ON_START=false - GAME_PORT=8211 - MAX_PLAYERS=16 - - SERVER_NAME=jammsen-docker-generated - - SERVER_PASSWORD= - MULTITHREAD_ENABLED=true - COMMUNITY_SERVER=true - PUBLIC_IP= diff --git a/servermanager.sh b/servermanager.sh index 29ec1e2..4d32640 100644 --- a/servermanager.sh +++ b/servermanager.sh @@ -18,16 +18,23 @@ function startServer() { echo ">>> Starting the gameserver" cd $GAME_PATH + echo "Checking for config" if [ ! -f ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini ]; then + echo "No config found, generating one" if [ ! -d ${GAME_PATH}/Pal/Saved/Config/LinuxServer ]; then mkdir -p ${GAME_PATH}/Pal/Saved/Config/LinuxServer fi - wget -qO ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini https://raw.githubusercontent.com/jammsen/docker-palworld-dedicated-server/master/PalWorldSettings.ini - sed -i -e "s/###RANDOM###/$RANDOM/g" ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini + curl -o ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini https://raw.githubusercontent.com/jammsen/docker-palworld-dedicated-server/master/PalWorldSettings.ini +# wget -qO ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini https://raw.githubusercontent.com/jammsen/docker-palworld-dedicated-server/master/PalWorldSettings.ini + RAND_VALUE=$RANDOM + echo "Servername is now jammsen-docker-generated-$RAND_VALUE" + sed -i -e "s/###RANDOM###/$RAND_VALUE/g" ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini if [[ -n $PUBLIC_IP ]]; then + echo "Setting Public IP to $PUBLIC_IP" sed -i -e "s/###IP###/$PUBLIC_IP/g" ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini fi if [[ -n $PUBLIC_PORT ]]; then + echo "Setting Public Port to $PUBLIC_PORT" sed -i -e "s/###PORT###/$PUBLIC_PORT/g" ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini fi fi