alec-hs / Flaxs-Arma-Server-Tool-2

Full rebuild of my tool for installing and updating Arma 3 server with built in features for managing Steam Workshop mods.
https://forums.bohemia.net/forums/topic/220433-fast2-arma-server-and-steam-workshop-tool/
GNU General Public License v3.0
35 stars 21 forks source link

Steam Command - Retry on failure. #112

Open CableFerret opened 4 years ago

CableFerret commented 4 years ago

Also, mod download failure;

Prior to the discovery of FAST2 for server management, I utilised a number of self-written bash and python scripts to manage our Arma3 server.
In order to download and keep the mods up to date, I had a python script that would scan for the workshop version number and upgrade on mismatch.
Obviously, though, Steam Workshop is a bit flaky from SteamCLI and often fails on larger downloads, a problem that exists within FAST2 as well. This script had a flag that could be set to auto-retry N times if the download failed. Integration of a feature such as this into FAST2 could counter some of the downloads failed errors and negate the necessity to restart updates on failure.

Whilst I have not worked with this particular code language before, I've got some knowledge of python3 and PythonQT to make interfaces. I would be happy to try creating a code contribution for the two above issues should any action be required.

Kind regards, CableFerret

CableFerret commented 4 years ago

For the Downloads fix it would be straightforward to add a retry variable and if retry > 2: error check to the beginning of the script. Run an additional version check after the download reports completed, relaunch on fail response and +1 to the retry count.

Would I be okay to push a new branch with suggested changes?

alec-hs commented 4 years ago

Sounds great, feel free to push a branch.

CableFerret commented 4 years ago

Ace, I'll look at how to compile a test build to make sure nothing is borked before pushing to MapContent branch.

Looking into the SteamCMD download retry function.
This is mostly preliminary guesswork atm, until I can get a local build working, but there seems to be a couple of places we may be able to implement the change.

SteamMods.xaml.vb (UpdateMod); Putting it here would limit it's activity to workshop mod downloads but would require additional error handling within this function to read the text output. Not a massive issue as we should be able to call the MainWindow.Instance.IMessageDialogText to parse for 'Timeout' and it can be added to the very end of the code without disrupting the rest of the function.

MainWindow.xaml.vb (RunSteamCommand); Alternatively it could be implemented in the command sending function, meaning it would cover any Steam action in the event of connection interruption or service error, also keeping the SteamCMD error handling in one place. However, this would somewhat pollute an already extensive function, making debugging just that bit more complicated.

What do you think?

alec-hs commented 4 years ago

Sorry for the late reply, best case would be good to include it for all Steam Commands - however no harm in creating a new Private Sub in MainWindow and call that inside RunSteamCommand. Keeps the old function cleaner that way.

Also I've separated out these things into a couple issues for clarity sake - a different branch for each issue would be great. Happy for you to look at both or I'll take one of them if you'd rather focus on one. New issue here.