Open eris667 opened 3 years ago
Hey, good question! I hadn't planned on adding something like that. But I think I could get about halfway there.
So I'll leave this issue open to investigate adding a game version check + prompt. Thanks for the suggestion!
I can create a simple batch file to start the dedicated server via the steam URL protocol (thinking that would trigger the update sequence), and run that daily ~15m before the machine restarts -- would that cause any issues with the running server?
batch file example (run at 1am, restart machine at 1:15am)
rem Valheim dedicated server launch
start "" steam://rungameid/896660
I haven't used the Steam browser protocol before, but I found these docs. For run
, it says "Runs an application. It will be installed if necessary." Does that mean it will be updated if necessary, as well? I'm not sure, and I don't have any games that need updating in order to test it out.
Running that in a batch file, however, will trigger the "start_headless_server.bat" file that ships with VDS, which means (unless you've modified it) it will create and run a world called "Dedicated" with password "password", and start running it in the background. You probably don't want it to start the server if you just want to install an update.
Instead, you could try forcing Steam to do the update in the background:
start "" "steam://nav/games"
Hopefully, this will effectively schedule Steam to download any VDS updates as soon as they're available. Although I'm not sure how you'd check if the download is done. Anyway, it seems just hacky enough to work. Let me know if you get something figured out!
hmmm - in the interim I just edited the start_headless_server.bat and put rem in front of the server start command (last line on the default file) It is pretty hacky though....
I will try and find a game that needs updated and try your suggestion
start "" "steam://nav/games"
Steps 2 & 3 were set previous to the last update (and verified after it did not install)
I wonder if it will error out when it tries to update and the server is already running via the GUI? (files in use) all the script does is trick Steam into installing the update (Steam doesn't realize a server is running)
FYI I have my Valheim server installed with Steamcmd, and I use this app to keep the Valheim server autoupdated: https://github.com/tmmjelde/Valheim-Dedicated-Windows
For comparison, this other app attempted but failed to implement autoupdate: https://github.com/Razzmatazzz/ValheimServerWarden
Update was released yesterday (0.154.1) I waited until the next morning (after my update hack / computer daily reset) and the dedicated server was now on the current version -- so based on the limited test data (one sample) it was enough to trigger the update to install
Awesome! Also, a question @eris667 how do you install mods on the server? Currently trying to add - https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/
Thanks!
@EddBerkel I have not modded my server - but I would start here:
The server GUI and auto restart is a great tool - tyvm
Recently the game updated to a new version (0.153.2) and Steam had the update queued for a few days but never applied the update
Is there a planned feature / verification (even possible?) to check if an update exists, apply it, then start the server? My hypothesis is that the server is always running so steam never updates?