Skip to content

Commit

Permalink
Merge pull request #281 from jammsen/develop
Browse files Browse the repository at this point in the history
Release 2024-09-20.1
  • Loading branch information
jammsen authored Sep 20, 2024
2 parents 6ae4121 + 76f834c commit a425e98
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 10 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog

[Back to main](README.md#changelog)
## 2024-09-20

- added process-based Healthcheck @jammsen (#275)

## 2024-08-15

- added support for variable SUPPLY_DROP_SPAN @KyleDiao (#279)

## 2024-08-12

- added support to turn off backup-announcements, to have less spammy chat ingame, but errors will always be announced @Jadiction @jammsen (#272)

## 2024-06-24

Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
STEAMCMD_VALIDATE_FILES=true \
# Backup-settings
BACKUP_ENABLED=true \
BACKUP_ANNOUNCE_MESSAGES_ENABLED=true \
BACKUP_CRON_EXPRESSION="0 * * * *" \
BACKUP_RETENTION_POLICY=true \
BACKUP_RETENTION_AMOUNT_TO_KEEP=72 \
Expand Down Expand Up @@ -177,7 +178,8 @@ ENV DEBIAN_FRONTEND=noninteractive \
SHOW_PLAYER_LIST=false \
ALLOW_CONNECT_PLATFORM=Steam \
ENABLE_WORLD_BACKUP=false \
LOG_FORMAT_TYPE=Text
LOG_FORMAT_TYPE=Text \
SUPPLY_DROP_SPAN=180

EXPOSE 8211/udp
EXPOSE 25575/tcp
Expand Down Expand Up @@ -208,5 +210,8 @@ RUN mkdir -p "$BACKUP_PATH" \

VOLUME ["${GAME_ROOT}"]

HEALTHCHECK --interval=10s --timeout=10s --start-period=30s --retries=3 \
CMD pgrep -x "PalServer-Linux" >/dev/null 2>&1 || exit 1

ENTRYPOINT ["/entrypoint.sh"]
CMD ["/scripts/servermanager.sh"]
2 changes: 1 addition & 1 deletion configs/PalWorldSettings.ini.template
Original file line number Diff line number Diff line change
@@ -1,2 +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,BaseCampMaxNumInGuild=4,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,AutoSaveSpan=30.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,bInvisibleOtherGuildBaseCampAreaFX=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",RESTAPIEnabled=False,RESTAPIPort=8212,bShowPlayerList=False,AllowConnectPlatform=Steam,bIsUseBackupSaveData=True,LogFormatType=Text)
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,BaseCampMaxNumInGuild=4,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,AutoSaveSpan=30.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,bInvisibleOtherGuildBaseCampAreaFX=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",RESTAPIEnabled=False,RESTAPIPort=8212,bShowPlayerList=False,AllowConnectPlatform=Steam,bIsUseBackupSaveData=True,LogFormatType=Text,SupplyDropSpan=180)
2 changes: 2 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ALWAYS_UPDATE_ON_START=true
STEAMCMD_VALIDATE_FILES=true
# Backup-settings
BACKUP_ENABLED=true
BACKUP_ANNOUNCE_MESSAGES_ENABLED=true
BACKUP_CRON_EXPRESSION=0 * * * *
BACKUP_RETENTION_POLICY=true
BACKUP_RETENTION_AMOUNT_TO_KEEP=72
Expand Down Expand Up @@ -120,3 +121,4 @@ SHOW_PLAYER_LIST=false
ALLOW_CONNECT_PLATFORM=Steam
ENABLE_WORLD_BACKUP=false
LOG_FORMAT_TYPE=Text
SUPPLY_DROP_SPAN=180
2 changes: 2 additions & 0 deletions docs/ENV_VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ These settings control the behavior of the Docker container:
| ALWAYS_UPDATE_ON_START | Updates the server on startup | true | Boolean |
| STEAMCMD_VALIDATE_FILES | Set to enabled SteamCMD will also validate the gameserver files, making sure nothing is corrupted and also overwrite any file changes of the source | true | Boolean |
| BACKUP_ENABLED | Backup function, creates backups in your `game` directory | true | Boolean |
| BACKUP_ANNOUNCE_MESSAGES_ENABLED | While creating backups, this controls if announces are posted to the gameserver; Important: Errors will always be announced! | true | Boolean |
| BACKUP_CRON_EXPRESSION | Needs a Cron-Expression - See [Cron expression](#cron-expression) | 0 * * * * (meaning every hour) | Cron-Expression |
| BACKUP_RETENTION_POLICY | Set to enabled, will cleanup old backups | true | Boolean |
| BACKUP_RETENTION_AMOUNT_TO_KEEP | Defines how many backups in numbers to keep | 72 | Integer |
Expand Down Expand Up @@ -149,6 +150,7 @@ Information sources and credits to the following websites:
| ALLOW_CONNECT_PLATFORM | AllowConnectPlatform | Looks like Cross-Play, but according to official documentation, isnt working yet and no more infos given on this; See: https://tech.palworldgame.com/settings-and-operation/configuration | Steam | String |
| ENABLE_WORLD_BACKUP | bIsUseBackupSaveData | Enables internal world backup inside the game-server; off by default, because we have our own backup solution | false | Boolean |
| LOG_FORMAT_TYPE | LogFormatType | Log format Text or Json | Text | Enum |
| SUPPLY_DROP_SPAN | SupplyDropSpan | Interval for supply drop (and meteorite drop) (minutes) | 180 | Integer |


** Updates to descriptions taken from [this reddit post](https://www.reddit.com/r/Palworld/comments/19bumby/settings_explanation/) **
Expand Down
4 changes: 4 additions & 0 deletions includes/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ function setup_palworld_settings_ini() {
e "> Setting LogFormatType to '$LOG_FORMAT_TYPE'"
sed -E -i "s/LogFormatType=[a-zA-Z]*/LogFormatType=$LOG_FORMAT_TYPE/" "$GAME_SETTINGS_FILE"
fi
if [[ -n ${SUPPLY_DROP_SPAN+x} ]]; then
e "> Setting SupplyDropSpan to '$SUPPLY_DROP_SPAN'"
sed -E -i "s/SupplyDropSpan=[0-9]*/SupplyDropSpan=$SUPPLY_DROP_SPAN/" "$GAME_SETTINGS_FILE"
fi
es ">>> Finished setting up PalWorldSettings.ini"
}

Expand Down
24 changes: 16 additions & 8 deletions scripts/backupmanager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source /includes/colors.sh
source /includes/rcon.sh

# Default values if the environment variables exist
LOCAL_BACKUP_ANNOUNCE_MESSAGES_ENABLED=${BACKUP_ANNOUNCE_MESSAGES_ENABLED} # Defines if messages should be announced via rcon
LOCAL_BACKUP_PATH=${BACKUP_PATH} # Directory where the backup files are stored
LOCAL_GAME_PATH=${GAME_PATH} # Directory where the game save files are stored
LOCAL_GAME_SAVE_PATH=${GAME_SAVE_PATH} # Directory where the game save files are stored
Expand Down Expand Up @@ -136,19 +137,26 @@ function create_backup() {

mkdir -p "${LOCAL_BACKUP_PATH}"

rconcli broadcast "$(get_time) Saving in 5 seconds..."
sleep 5
rconcli broadcast "$(get_time) Saving world..."
rconcli save
rconcli broadcast "$(get_time) Saving done"
sleep 15
rconcli broadcast "$(get_time) Creating backup..."
if [[ -n $LOCAL_BACKUP_ANNOUNCE_MESSAGES_ENABLED ]] && [[ $LOCAL_BACKUP_ANNOUNCE_MESSAGES_ENABLED == "true" ]]; then
rconcli broadcast "$(get_time) Saving in 5 seconds..."
sleep 5
rconcli broadcast "$(get_time) Saving world..."
rconcli save
rconcli broadcast "$(get_time) Saving done"
sleep 15
rconcli broadcast "$(get_time) Creating backup..."
else
rconcli save
fi


if ! tar cfz "${LOCAL_BACKUP_PATH}/${backup_file_name}" -C "${LOCAL_GAME_PATH}/" --exclude "backup" "Saved" ; then
broadcast_backup_failed
ee ">>> Backup failed"
else
broadcast_backup_success
if [[ -n $LOCAL_BACKUP_ANNOUNCE_MESSAGES_ENABLED ]] && [[ $LOCAL_BACKUP_ANNOUNCE_MESSAGES_ENABLED == "true" ]]; then
broadcast_backup_success
fi
es ">>> Backup '${backup_file_name}' created successfully"
fi

Expand Down

0 comments on commit a425e98

Please sign in to comment.