Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into work
Browse files Browse the repository at this point in the history
  • Loading branch information
ripps818 committed Feb 28, 2024
2 parents d6e8c48 + 291a0bf commit f597338
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 78 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

[Back to main](README.md#changelog)

## 2024-02-27

- Added clearer descriptions in the ENV_VARS documentation by @m1xzg
- Added new mechanic to comply with changes for update 0.1.5.0 by @jammsen and @Callum027 (#236)
- Introduced new template file for PalWorldSettings.ini
- Added new option for ShowPlayerList
- Updated option for Community-Mode servers

## 2024-02-25

- Added new mechanic for customization of webhook content-titles (#223)

## 2024-02-24

- Added new mechanic for auto-restart, where the player count will be checked, 15 minutes grace-period (for dungeons, boss-fights, etc.) will only used if a player is online, if not the restart will be initiated (#230)
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
GAME_ENGINE_FILE="/palworld/Pal/Saved/Config/LinuxServer/Engine.ini" \
STEAMCMD_PATH="/home/steam/steamcmd" \
RCON_CONFIG_FILE="/home/steam/steamcmd/rcon.yaml" \
PALWORLD_TEMPLATE_FILE="/PalWorldSettings.ini.template" \
BACKUP_PATH="/palworld/backups" \
# Container-setttings
PUID=1000 \
Expand Down Expand Up @@ -93,6 +94,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
WEBHOOK_ENABLED=false \
WEBHOOK_DEBUG_ENABLED=false \
WEBHOOK_URL= \
WEBHOOK_CONTENT_TITLE="Status update" \
WEBHOOK_INFO_TITLE="Info" \
WEBHOOK_INFO_DESCRIPTION="This is an info from the server" \
WEBHOOK_INFO_COLOR="2849520" \
Expand Down Expand Up @@ -181,7 +183,8 @@ ENV DEBIAN_FRONTEND=noninteractive \
RCON_PORT=25575 \
REGION= \
USEAUTH=true \
BAN_LIST_URL=https://api.palworldgame.com/api/banlist.txt
BAN_LIST_URL=https://api.palworldgame.com/api/banlist.txt \
SHOW_PLAYER_LIST=false

EXPOSE 8211/udp
EXPOSE 25575/tcp
Expand Down Expand Up @@ -245,6 +248,7 @@ COPY --chmod=755 entrypoint.sh /
COPY --chmod=755 scripts/ /scripts
COPY --chmod=755 includes/ /includes
COPY --chmod=755 configs/rcon.yaml /home/steam/steamcmd/rcon.yaml
COPY --chmod=755 configs/PalWorldSettings.ini.template /
COPY --chmod=755 gosu-amd64 /usr/local/bin/gosu

RUN mkdir -p "$BACKUP_PATH" \
Expand Down
2 changes: 2 additions & 0 deletions configs/PalWorldSettings.ini.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[/Script/Pal.PalGameWorldSettings]
OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=1.000000,ExpRate=1.000000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=1.000000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=1.000000,DeathPenalty=All,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=True,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNum=128,BaseCampWorkerMaxNum=15,DropItemAliveMaxHours=1.000000,bAutoResetGuildNoOnlinePlayers=False,AutoResetGuildTimeNoOnlinePlayers=72.000000,GuildPlayerMaxNum=20,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,CoopPlayerMaxNum=4,ServerPlayerMaxNum=32,ServerName="Default Palworld Server",ServerDescription="",AdminPassword="",ServerPassword="",PublicPort=8211,PublicIP="",RCONEnabled=False,RCONPort=25575,Region="",bUseAuth=True,BanListURL="https://api.palworldgame.com/api/banlist.txt",bShowPlayerList=false)
2 changes: 2 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RCON_PLAYER_DETECTION_CHECK_INTERVAL=15
WEBHOOK_ENABLED=false
WEBHOOK_DEBUG_ENABLED=false
WEBHOOK_URL="YOUR-URL-IN-HERE"
WEBHOOK_CONTENT_TITLE="Status update"
WEBHOOK_INFO_TITLE="Info"
WEBHOOK_INFO_DESCRIPTION="This is an info from the server"
WEBHOOK_INFO_COLOR="2849520"
Expand Down Expand Up @@ -115,3 +116,4 @@ RCON_PORT=25575
REGION=
USEAUTH=true
BAN_LIST_URL=https://api.palworldgame.com/api/banlist.txt
SHOW_PLAYER_LIST=false
146 changes: 76 additions & 70 deletions docs/ENV_VARS.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fi
chown -R "$APP_USER":"$APP_GROUP" "$APP_HOME"
chown -R "$APP_USER":"$APP_GROUP" "$GAME_ROOT"
chown "$APP_USER":"$APP_GROUP" /entrypoint.sh
chown "$APP_USER":"$APP_GROUP" /PalWorldSettings.ini.template
chown -R "$APP_USER":"$APP_GROUP" /scripts
chown -R "$APP_USER":"$APP_GROUP" /includes

Expand Down
11 changes: 7 additions & 4 deletions includes/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function setup_engine_ini() {
fi
# Create empty Engine.ini file
echo "" > "${GAME_ENGINE_FILE}"
else
else
e "> Found existing config!"
fi
if grep -qE "${pattern1}" "${GAME_ENGINE_FILE}" 2>/dev/null; then
Expand All @@ -39,9 +39,8 @@ function setup_palworld_settings_ini() {
mkdir -p "${GAME_CONFIG_PATH}/"
fi
# Copy default-config, which comes with SteamCMD to gameserver save location
ew "> Copying DefaultPalWorldSettings.ini to ${GAME_SETTINGS_FILE}"
cp "${GAME_ROOT}/DefaultPalWorldSettings.ini" "${GAME_SETTINGS_FILE}"

ew "> Copying PalWorldSettings.ini.template to ${GAME_SETTINGS_FILE}"
cp "${PALWORLD_TEMPLATE_FILE}" "${GAME_SETTINGS_FILE}"

if [[ -n ${DIFFICULTY+x} ]]; then
e "> Setting Difficulty to '$DIFFICULTY'"
Expand Down Expand Up @@ -297,6 +296,10 @@ function setup_palworld_settings_ini() {
e "> Setting BanListURL to '$BAN_LIST_URL'"
sed -E -i "s~BanListURL=\"[^\"]*\"~BanListURL=\"$BAN_LIST_URL\"~" "$GAME_SETTINGS_FILE"
fi
if [[ -n ${SHOW_PLAYER_LIST+x} ]]; then
e "> Setting bShowPlayerList to '$SHOW_PLAYER_LIST'"
sed -E -i "s/bShowPlayerList=[a-zA-Z]*/bShowPlayerList=$SHOW_PLAYER_LIST/" "$GAME_SETTINGS_FILE"
fi
es ">>> Finished setting up PalWorldSettings.ini"
}

Expand Down
6 changes: 5 additions & 1 deletion includes/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ function start_server() {
START_OPTIONS=()
if [[ -n $COMMUNITY_SERVER ]] && [[ $COMMUNITY_SERVER == "true" ]]; then
e "> Setting Community-Mode to enabled"
START_OPTIONS+=("EpicApp=PalServer")
START_OPTIONS+=("-publiclobby")
fi
if [[ -n $MULTITHREAD_ENABLED ]] && [[ $MULTITHREAD_ENABLED == "true" ]]; then
e "> Setting Multi-Core-Enhancements to enabled"
START_OPTIONS+=("-useperfthreads" "-NoAsyncLoadingThread" "-UseMultithreadForDS")
fi
if [[ -n $RCON_ENABLED ]] && [[ $RCON_ENABLED == "true" ]]; then
e "> Enabling RCON port"
START_OPTIONS+=("-rcon")
fi
if [[ -n $WEBHOOK_ENABLED ]] && [[ $WEBHOOK_ENABLED == "true" ]]; then
send_start_notification
fi
Expand Down
16 changes: 14 additions & 2 deletions includes/webhook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,28 @@
# IMPORTANT: Don't use Hex-Colors! Go to the page, search for the Hex-Color,
# after that add the DECIMAL-Representation to the color field or it will break for Discord!
generate_post_data() {
cat <<EOF
if [[ -n "${WEBHOOK_CONTENT_TITLE}" ]]; then
cat <<EOF
{
"content": "Status update",
"content": "${WEBHOOK_CONTENT_TITLE}",
"embeds": [{
"title": "$1",
"description": "$2",
"color": "$3"
}]
}
EOF
else
cat <<EOF
{
"embeds": [{
"title": "$1",
"description": "$2",
"color": "$3"
}]
}
EOF
fi
}

send_webhook_notification() {
Expand Down

0 comments on commit f597338

Please sign in to comment.