Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add community server options #3

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
FROM cm2network/steamcmd:root
LABEL maintainer="[email protected]"

RUN apt-get update && apt-get install -y \
xdg-user-dirs
RUN apt-get update && apt-get install -y --no-install-recommends \
xdg-user-dirs=0.17-2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*


ENV PORT=8211 \
PLAYERS=16 \
MULTITHREADING=FALSE
MULTITHREADING=false \
COMMUNITY=false \
PUBLIC_IP= \
PUBLIC_PORT= \
SERVER_PASSWORD=

COPY ./scripts/* /home/steam/server/
RUN chmod +x /home/steam/server/init.sh /home/steam/server/start.sh
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,15 @@ It is highly recommended you set the following environment values before startin
* PORT
* MULTITHREADING

| Variable | Info | Default Values | Allowed Values |
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|----------------|
| PLAYERS* | Max amount of players that are able to join the server | 16 | 1-31 |
| PORT* | UDP port that the server will expose | 8211 | 1024-65535 |
| MULTITHREADING** | Improves performance in multi-threaded CPU environments. It is effective up to a maximum of about 4 threads, and allocating more than this number of threads does not make much sense. | false | true/false |
| Variable | Info | Default Values | Allowed Values |
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|----------------|
| PLAYERS* | Max amount of players that are able to join the server | 16 | 1-31 |
| PORT* | UDP port that the server will expose | 8211 | 1024-65535 |
| MULTITHREADING** | Improves performance in multi-threaded CPU environments. It is effective up to a maximum of about 4 threads, and allocating more than this number of threads does not make much sense. | false | true/false |
| COMMUNITY | Whether or not the server shows up in the community server browser (USE WITH SERVER_PASSWORD) | false | true/false |
| PUBLIC_IP | You can manually specify the global IP address of the network on which the server running.If not specified, it will be detected automatically. If it does not work well, try manual configuration. | | x.x.x.x |
| PUBLIC_PORT | You can manually specify the port number of the network on which the server running.If not specified, it will be detected automatically. If it does not work well, try manual configuration. | | x.x.x.x |
| SERVER_PASSWORD | Secure your community server with a password | | string |

*highly recommended to set

Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
palworld:
image: thijsvanloef/palworld-server-docker
image: thijsvanloef/palworld-server-docker:latest
restart: unless-stopped
container_name: palworld-server
ports:
Expand All @@ -9,6 +9,7 @@ services:
environment:
- PORT=8211
- PLAYERS=16
- MULTITHREADING=FALSE
- MULTITHREADING=false
- COMMUNITY=false # Enable this if you want your server to show up in the community servers tab, USE WITH SERVER_PASSWORD!
volumes:
- /path/to/your/palworld/folder:/palworld/
- ./palworld:/palworld/
32 changes: 26 additions & 6 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
#!/bin/sh


STARTCOMMAND="./PalServer.sh -port=${PORT} -players=${PLAYERS}"

printf "\e[0;32m*****STARTING SERVER*****\e[0m"
cd /palworld || exit

if [ "${COMMUNITY}" = true ]; then
STARTCOMMAND="${STARTCOMMAND} EpicApp=PalServer"
fi

if [ -n "${PUBLIC_IP}" ]; then
STARTCOMMAND="${STARTCOMMAND} -publicip=${PUBLIC_IP}"
fi

if [ -n "${PUBLIC_PORT}" ]; then
STARTCOMMAND="${STARTCOMMAND} -publiport=${PUBLIC_PORT}"
fi

if [ -n "${SERVER_PASSWORD}" ]; then
STARTCOMMAND="${STARTCOMMAND} -serverpassword=${SERVER_PASSWORD}"
fi

if [ "${MULTITHREADING}" = true ]; then
su steam -c "${STARTCOMMAND} -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"
else
su steam -c "${STARTCOMMAND}"
fi
STARTCOMMAND="${STARTCOMMAND} -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"
fi

cd /palworld || exit

echo "${STARTCOMMAND}"

printf "\e[0;32m*****STARTING SERVER*****\e[0m"

su steam -c "${STARTCOMMAND}"
Loading