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

Update master from work #26

Merged
merged 17 commits into from
Sep 16, 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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Changelog

[Back to main](README.md#changelog)
## 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

- added support for new variables @jammsen (#276)

## 2024-06-24

- Add support-documentation for Xbox-Dedicated-Servers @jammsen (#269)

## 2024-06-24

Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,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 @@ -192,7 +193,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
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 @@ -11,6 +11,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 @@ -125,3 +126,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 @@ -19,6 +19,7 @@ These settings control the behavior of the Docker container:
| WINETRICK_ON_START | Installs the Visual C++ runtime on startup. Can be turned to false after server is setup. | 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 @@ -153,6 +154,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
29 changes: 15 additions & 14 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,25 +137,25 @@ function create_backup() {

mkdir -p "${LOCAL_BACKUP_PATH}"

if [[ $RCON_QUIET_BACKUP == false ]]; then
rconcli "broadcast $(get_time) Saving in 5 seconds..."
fi
sleep 5
if [[ $RCON_QUIET_BACKUP == false ]]; then
rconcli 'broadcast $(get_time) Saving-world...'
fi
rconcli 'save'
if [[ $RCON_QUIET_BACKUP == false ]]; then
rconcli 'broadcast $(get_time) Saving done'
sleep 15
rconcli 'broadcast $(get_time) Creating-backup'
fi
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