Skip to content

Commit

Permalink
partial fix part four
Browse files Browse the repository at this point in the history
  • Loading branch information
jammsen committed Jan 19, 2024
1 parent 426061d commit 9cece17
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ 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 |
| ---------------------- | ---------------------------------------------------------------- | ------------- | ------------- |
| 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 |
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
11 changes: 9 additions & 2 deletions servermanager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9cece17

Please sign in to comment.