Razzmatazzz / ValheimServerWarden

Manage one or more Valheim dedicated server instances.
GNU General Public License v3.0
38 stars 4 forks source link

Add optional command to run on start (umod update, etc) #26

Closed doublee313 closed 3 years ago

doublee313 commented 3 years ago

Would it be possible to add a startup command line to run commands? IE for umod update on start:

umod update game core apps extensions --patch-available --strict --validate --prerelease

Thank you.

Razzmatazzz commented 3 years ago

Probably possible, but I need to know the mechanics of how this works. Do you run the umod command before or after you start the server? Does the umod process have to finish before the server starts? Should this command run every time before the server starts (e.g., when installing automatic server updates, when performing scheduled restarts), or just the first time the server is started after the VSW app is first launched?

doublee313 commented 3 years ago

I'm no expert but here's the launcher.bat file:

@echo off cls :start

umod update game core apps extensions --patch-available --strict --validate --prerelease

@echo off if %ERRORLEVEL% == 1 (echo Unable to update game, uMod core, or uMod apps.) if %ERRORLEVEL% == 2 (echo No updated needed.)

echo Starting server...

valheim_server.exe -batchmode -nographics -name "Server" -port 2456 -world "Server" -password 00000 -public 1 -savedir "D:\Valheim\Saves"

This seems to run each time to check for the update.

doublee313 commented 3 years ago

Maybe the "game" isn't needed....as yours has the auto update

Maybe make a Umod section where you can install the umod core and option to check for update on server start?

Rust Server Manager example:

image

You can build on the plugin, etc later too.

I'm going to send you a donation in the next week for all your work. Awesome job.

Razzmatazzz commented 3 years ago

I have zero familiarity with umod, but am I correct in understanding that this command updates the game, umod, and any umod apps and extensions?

doublee313 commented 3 years ago

Yes, that seems to be the formatting. I can test a beta if you need, etc.

I'm using uMod and 4-5 plugins on my servers: Max Players, Auto Save, etc. It should be a huge thing soon :)

Razzmatazzz commented 3 years ago

Can you do windows key+R, paste in %userprofile%/.dotnet/tools/ and tell me if umod.exe is located in that folder?

doublee313 commented 3 years ago

image

:)

Razzmatazzz commented 3 years ago

When you install umod on a server, does it add another umod.exe to the server folder as well?

doublee313 commented 3 years ago

No, it just creates a umod folder in the server folder with it's stuff. The umod.exe is where you had above I believe when you install the Umod installer.

Here's a search for umod in the folder:

image

Razzmatazzz commented 3 years ago

Gotcha. Thanks.

Razzmatazzz commented 3 years ago

I haven't installed uMod myself because installing via a powershell script with no uninstall option seems sketchy to me. But having looked at the documentation, the attached test build might have some uMod functionality. Or it might make everything explode. If it successfully detects uMod installed on your PC, and you select "uMod" as the installation method, it should show a "uMod" tab. A button on that tab lets you do a manual update when the server isn't running. When the server is running, it should use uMod for all updates.

Or maybe it won't... hard to test since I don't have uMod installed myself. Try at your own risk.

Edited to change the test version to one that actually calls the uMod update command.

Edit: test version removed and new one attached below.

doublee313 commented 3 years ago

I will test shortly. Thx. Driving home.

On Sat, Mar 6, 2021, 3:15 PM Razzmatazzz notifications@github.com wrote:

vsw-umod-test.zip https://github.com/Razzmatazzz/ValheimServerWarden/files/6096027/vsw-umod-test.zip I haven't installed uMod myself because installing via a powershell script with no uninstall option seems sketchy to me. But having looked at the documentation, the attached test build might have some uMod functionality. Or it might make everything explode. If it successfully detects uMod installed on your PC, and you select "uMod" as the installation method, it should show a "uMod" tab. A button on that tab lets you do a manual update when the server isn't running. When the server is running, it should use uMod for all updates.

Or maybe it won't... hard to test since I don't have uMod installed myself. Try at your own risk.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Razzmatazzz/ValheimServerWarden/issues/26#issuecomment-792045837, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGH7TSP54SRPZN5QAUDXMHDTCKEOJANCNFSM4YWY4T5Q .

Razzmatazzz commented 3 years ago

vsw-umod-test.zip Use this version instead. It fixes some bugs.

One disadvantage of using uMod over SteamCMD is that there's no way I know of to check whether there's an update available without actually doing an update. That means when the server is running, you can't just check for an update and then shut down the server to apply it. You have to shut down the server, then do the update command (which installs an update if available) and then start the server back up.

doublee313 commented 3 years ago

I will now and report back. Thx

On Sat, Mar 6, 2021, 7:00 PM Razzmatazzz notifications@github.com wrote:

vsw-umod-test.zip https://github.com/Razzmatazzz/ValheimServerWarden/files/6096326/vsw-umod-test.zip Use this version instead. It fixes some bugs.

One disadvantage of using uMod over SteamCMD is that there's no way I know of to check whether there's an update available without actually doing an update. That means when the server is running, you can't just check for an update and then shut down the server to apply it. You have to shut down the server, then do the update command (which installs an update if available) and then start the server back up.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Razzmatazzz/ValheimServerWarden/issues/26#issuecomment-792124595, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGH7TSPEDV5752E6NOCAOYTTCK63RANCNFSM4YWY4T5Q .

doublee313 commented 3 years ago

I think the idea is, umod will update on start if need after the update. The game itself can be updated with SteamCMD, etc.

Razzmatazzz commented 3 years ago

Is that safe practice for uMod? uMod has its own command to update the game and uses the --patch-available flag to skip game updates "if corresponding patched assemblies are not available".

Based on my understanding, you can get yourself into trouble if you're using uMod and update the game outside of uMod. Am I incorrect in that understanding?

doublee313 commented 3 years ago

I never update the game with umod just its files (Rust).

With Rust, after it SteamCmd update, we have to manually push it. This new way seems nice to check on start just for the umod parts. Probably no need for game update if that part refers to the actual Steam game files.

Waiting for a player to log and will test.

On Sun, Mar 7, 2021, 7:23 AM Razzmatazzz notifications@github.com wrote:

Is that safe practice for uMod? uMod has its own command to update the game and uses the --patch-available flag to skip game updates "if corresponding patched assemblies are not available https://umod.org/guides/getting-started/agent#update".

Based on my understanding, you can get yourself into trouble if you're using uMod and update the game outside of uMod. Am I incorrect in that understanding?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Razzmatazzz/ValheimServerWarden/issues/26#issuecomment-792270284, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGH7TSKIYFVPZUZKY4O45U3TCNV4RANCNFSM4YWY4T5Q .

doublee313 commented 3 years ago

Ok, it's up and running. Started ok. I will let it run for a bit and see.

As for Umod updating the game, I would remove that part. Just the core, apps, extensions.

Also, maybe add a button to install Umod to the server :)

doublee313 commented 3 years ago

Im on Discord if you want to DM each other. Doublee#0313

On Sun, Mar 7, 2021, 7:39 AM doublee313 doublee313@gmail.com wrote:

I never update the game with umod just its files (Rust).

With Rust, after it SteamCmd update, we have to manually push it. This new way seems nice to check on start just for the umod parts. Probably no need for game update if that part refers to the actual Steam game files.

Waiting for a player to log and will test.

On Sun, Mar 7, 2021, 7:23 AM Razzmatazzz notifications@github.com wrote:

Is that safe practice for uMod? uMod has its own command to update the game and uses the --patch-available flag to skip game updates "if corresponding patched assemblies are not available https://umod.org/guides/getting-started/agent#update".

Based on my understanding, you can get yourself into trouble if you're using uMod and update the game outside of uMod. Am I incorrect in that understanding?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Razzmatazzz/ValheimServerWarden/issues/26#issuecomment-792270284, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGH7TSKIYFVPZUZKY4O45U3TCNV4RANCNFSM4YWY4T5Q .

Razzmatazzz commented 3 years ago

Preliminary uMod support added in 0.4.12.0.