LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

Feature/Steam Workshop support

Open FliesWithWind opened this issue 1 year ago • 4 comments

Description

For a while, I had a horrible but working script for downloading and updating Arma 3 mods from Steam Workshop. I figured it was about time I try adding it to LinuxGSM. The script was based on https://github.com/arkmanager/ark-server-tools

Changes in this PR are working, but are far from being pretty or complete in my opinion. I'm no bash magician, so I wanted to show it as it is, hoping for an initial review and suggestions.

I've added it as a separate module, to avoid conflicts with the current mods module. For now, it downloads mods for Arma 3 taken from the server config file.

workshopmods="450814997;2131302796"

Once we reach a working and pretty solution, the next steps would be to add support for other games, like Arc and Starboud, and add Steam Collections support.

Fixes #[3514] #[1894] #[1623] #[960]

Type of change

  • [ ] Bug fix (a change which fixes an issue).
  • [x] New feature (a change which adds functionality).
  • [ ] New Server (new server added).
  • [ ] Refactor (restructures existing code).
  • [ ] Comment update (typo, spelling, explanation, examples, etc).

Checklist

PR will not be merged until all steps are complete.

  • [x] This pull request links to an issue.
  • [x] This pull request uses the develop branch as its base.
  • [x] This pull request subject follows the Conventional Commits standard.
  • [x] This code follows the style guidelines of this project.
  • [x] I have performed a self-review of my code.
  • [ ] I have checked that this code is commented where required.
  • [x] I have provided a detailed enough description of this PR.
  • [x] I have checked if documentation needs updating.

Documentation

Documentation will definitely need an update, once this is ready for merge. :)

FliesWithWind avatar Apr 11 '23 06:04 FliesWithWind

Thanks for the awesome review! I'll apply your suggestions once I have more time. :)

FliesWithWind avatar May 27 '23 06:05 FliesWithWind

@FliesWithWind Do you plan to resume your work on this soon ? I would like to add a specific contribution for DayZ Mods which are currently supported only if we rename files with uppercase characters to lowercase.

Dr-Shadow avatar Jul 05 '23 16:07 Dr-Shadow

@Dr-Shadow

This project is alien to me and I might've misinterpreted your goal, so please take this with a grain of salt.

You can bulk-rename files to lowercase with:

for File in *; do
    if [[ -f $File ]]; then
        mv "$File" "${File,,}"
    fi
done

The ,, feature of parameter expansion was introduced in BASH 4.0.

That would immediately rename all files in the current working directory to their lowercase counterpart. This is a non-recursive approach, by the way.

However, this should be done very carefully, perhaps with --no-clobber, because mv(1) will by default blast away any existing files, should they exist. Another issue with bulk-renaming files in this manner is that you may have conflicts, which you'd have to handle afterwards, such as 'FilE' and 'FILE' being completely different, but both being the same when renamed to all lowercase.

If you need recursion, you can use the globstar shell option. See bash(1), heading SHELL BUILTIN COMMANDS, under 'shopt', where you should find a list of valid shell options which the shopt builtin can handle.

terminalforlife avatar Jul 05 '23 21:07 terminalforlife

@Dr-Shadow at the moment I have my hands full, but I will try to find some time this month to apply suggestions from @terminalforlife. You are more than welcome to contribute. Arma 3 mod files and folders also need to be in lowercase, so it will likely be the same for DayZ.

FliesWithWind avatar Jul 06 '23 06:07 FliesWithWind