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 server without delay if nobody is connected #349

Merged
merged 7 commits into from
Feb 11, 2024

Conversation

Luatan
Copy link
Contributor

@Luatan Luatan commented Feb 10, 2024

Context

  • The Updater should not wait to update the server, if there are no Players connected.

Choices

  • To check how many players are connected we are using RCON, since there is currently no other method
  • If players connects after the script has sent the message, the player will not know that there will be an update (if no discord webhook is used). This reduces the chance of this happening.

Test instructions

  1. set the following environment variables:
AUTO_UPDATE_ENABLED: true
AUTO_UPDATE_WARN_MINUTES: 1
AUTO_UPDATE_CRON_EXPRESSION: "* * * * *"
  1. Connect to the Server with a client
  2. change the buildid in palworld\steamapps\appmanifest_2394010.acf to a different value
  3. verify that the script waits for the time set in AUTO_UPDATE_WARN_MINUTES
  4. wait for the server to restart
  5. change the buildid again without connecting
  6. verify that the server is being stopped immediately after the cronjob was ran.

Checklist before requesting a review

  • I have performed a self-review of my code
  • I've added documentation about this change to the README.
  • I've not introduced breaking changes.

@raimannma
Copy link
Contributor

We probably wanna combine this with my PR: #347
Both need to get the playerlist

@Dashboy1998
Copy link
Contributor

We probably wanna combine this with my PR: #347 Both need to get the playerlist

I was actually thinking we make a function in helper_functions called get_player_count.

@Luatan
Copy link
Contributor Author

Luatan commented Feb 10, 2024

We probably wanna combine this with my PR: #347 Both need to get the playerlist

I was actually thinking we make a function in helper_functions called get_player_count.

Should I create a separate PR for this or does someone else wanna do it?

@raimannma
Copy link
Contributor

raimannma commented Feb 10, 2024

We probably wanna combine this with my PR: #347 Both need to get the playerlist

I was actually thinking we make a function in helper_functions called get_player_count.

Should I create a separate PR for this or does someone else wanna do it?

You could maybe just create a new PR with both our features implemented.
Or you could just copy my feature to this pr and extract the players count to the helpers function.
Doesn't really matter to me :)

@Luatan
Copy link
Contributor Author

Luatan commented Feb 11, 2024

I have added the new helper function get_player_count. Now the auto_reboot.sh and update.sh script both use this function to check how many players are online.

Copy link
Owner

@thijsvanloef thijsvanloef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, LGTM

@thijsvanloef thijsvanloef merged commit 49a118d into thijsvanloef:main Feb 11, 2024
7 checks passed
@Luatan Luatan deleted the auto-update-no-delay branch February 11, 2024 14:17
MusclePr pushed a commit to MusclePr/palworld-server-docker that referenced this pull request Jun 19, 2024
Update server without delay if nobody is connected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants