Skip to content

Commit

Permalink
Merge pull request #82 from jammsen/develop
Browse files Browse the repository at this point in the history
#64 Added the ability to change the ServerTickRate in the Engine.ini
  • Loading branch information
jammsen authored Jan 26, 2024
2 parents c98fcce + 410d2e7 commit 34417ca
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ ENV DEBIAN_FRONTEND=noninteractive \
PGID=0 \
TZ=Europe/Berlin \
ALWAYS_UPDATE_ON_START=true \
MAX_PLAYERS=32 \
MULTITHREAD_ENABLED=true \
COMMUNITY_SERVER=true \
RCON_ENABLED=true \
PUBLIC_IP=10.0.0.1 \
PUBLIC_PORT=8211 \
BACKUP_ENABLED=true \
BACKUP_CRON_EXPRESSION="0 * * * *" \
NETSERVERMAXTICKRATE=120 \
MAX_PLAYERS=32 \
SERVER_NAME=jammsen-docker-generated-###RANDOM### \
SERVER_DESCRIPTION="Palworld-Dedicated-Server running in Docker by jammsen" \
SERVER_PASSWORD=serverPasswordHere \
ADMIN_PASSWORD=adminPasswordHere \
BACKUP_ENABLED=true \
BACKUP_CRON_EXPRESSION="0 * * * *"
SERVER_PASSWORD=serverPasswordHere \
PUBLIC_IP=10.0.0.1 \
PUBLIC_PORT=8211 \
RCON_ENABLED=true

CMD ["/servermanager.sh"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Information-sources and credits to the following websites:

| Variable | Game setting | Description | Default Value | Allowed Value |
| ----------------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ------------- |
| NETSERVERMAXTICKRATE | NetServerMaxTickRate | Changes the TickRate of the server, be very careful with this setting! | 120 | 30-120 |
| DIFFICULTY | Difficulty | Choose one of the following:<br>`None`<br>`Normal`<br>`Difficult` | None | Enum |
| DAYTIME_SPEEDRATE | DayTimeSpeedRate | Day time speed - Smaller number means shorter days | 1.000000 | Float |
| NIGHTTIME_SPEEDRATE | NightTimeSpeedRate | Night time speed - Smaller number means shorter nights | 1.000000 | Float |
Expand Down
25 changes: 22 additions & 3 deletions servermanager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,27 @@ function startServer() {
echo ">>> Starting the gameserver"
cd $GAME_PATH

echo ">>> Setting up setting ..."
echo ">>> Setting up Engine.ini ..."
config_file="${GAME_PATH}/Pal/Saved/Config/LinuxServer/Engine.ini"
pattern1="OnlineSubsystemUtils.IpNetDriver"
pattern2="^NetServerMaxTickRate=[0-9]*"

if grep -qE "$pattern1" "$config_file"; then
echo "Found [/Script/OnlineSubsystemUtils.IpNetDriver] section"
else
echo "Found no [/Script/OnlineSubsystemUtils.IpNetDriver], adding it"
echo -e "\n[/Script/OnlineSubsystemUtils.IpNetDriver]" >> "$config_file"
fi
if grep -qE "$pattern2" "$config_file"; then
echo "Found NetServerMaxTickRate parameter, chaning it to $NETSERVERMAXTICKRATE"
sed -E -i "s/$pattern2/NetServerMaxTickRate=$NETSERVERMAXTICKRATE/" "$config_file"
else
echo "Found no NetServerMaxTickRate parameter, adding it to $NETSERVERMAXTICKRATE"
echo "NetServerMaxTickRate=$NETSERVERMAXTICKRATE" >> "$config_file"
fi
echo ">>> Finished setting up Engine.ini ..."

echo ">>> Setting up PalWorldSettings.ini ..."
echo "Checking if config exists"
if [ ! -f ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini ]; then
echo "No config found, generating one"
Expand Down Expand Up @@ -295,8 +315,7 @@ function startServer() {
sed -E -i "s~BanListURL=\"[^\"]*\"~BanListURL=\"$BAN_LIST_URL\"~" ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
# sed -E -i 's/BanListURL=(((ftp|http|https):\/\/)|(\/)|(..\/))(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/BanListURL=$BAN_LIST_URL/g' ${GAME_PATH}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
fi
echo ">>> Finished setting up settings ..."

echo ">>> Finished setting up PalWorldSettings.ini ..."

START_OPTIONS=""
if [[ -n $COMMUNITY_SERVER ]] && [[ $COMMUNITY_SERVER == "true" ]]; then
Expand Down

0 comments on commit 34417ca

Please sign in to comment.