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

Swap out InstanceSync for Cat-Downloader-Legacy #659

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

Kanzaji
Copy link
Contributor

@Kanzaji Kanzaji commented Aug 22, 2023

What is even Cat-Downloader-Legacy?

This PR was discussed on the Contributor channel, so for those that are out-of-topic and are curious, here is an explanation 😄
Cat-Downloader-Legacy is an app that is meant to be a replacement of InstanceSync, the old app Vazkii wrote a long time ago, and was archived not so long ago by him. InstanceSync (And Cat-Downloader-Legacy) are meant to allow easy synchronization of the mods between modpack developers and beta-testers, without doing releases on CurseForge or hoping CF App will update mods correctly when instance file is changed :D
It also has some more features, but more on that later.

Source code for the app

Source code of the app: https://github.com/Kanzaji/Cat-Downloader-Legacy
Release included in this PR: https://github.com/Kanzaji/Cat-Downloader-Legacy/releases/tag/2.1.2
The Project is under a MIT License, (And its mine😄) so licensing here is not a problem :D But better to mention that anyway.

Configuration

This PR contains everything related to setup of CDL, with scripts, app itself and .gitignore file changes. There is a lot more possible to configure, however defaults are pretty good already, and everything can be changed in just one line :D
Here is the explanation of the arguments used in the scripts of this PR:

  • -SettingsPath: -> Path to the config file (Absolute or Relative to the execution path)
  • -LogsPath: -> Path to the log folder. Creates the path if it doesn't exists. More on Logger later
  • -Mode: -> Forces the app to specified mode, there are 4 available, but CF-Instance is the one we need.
  • -DefaultSettings: -> Determines if the settings should be taken from the template (true) or generated from the arguments (false)

Note: Those explanations are pretty short ones, better explanation is here and here.

Scripts are created in a way to make changing argumentation fairly easy. There is a tiny tiny bug in the Config generation, that single \ characters break Settings File Parsing, however I'm working on the fix now, and when the update is ready, the app will be updated! (PR Can be merged even before the fix, scripts are created so it will work fine, and the app will update iself when new release is ready)

Features

CDL contains a lot more features comparing to the InstanceSync, everything is configurable and the app will log everything when it crashes :D Here is the full list of the features that can be disabled / configured if not stated otherwise:

  • Logger. The app generates log files, and can stockpile them to the speficied amount (10 is default, archived logs are compressed in the GZ format)
  • Settings File. It is nearly a direct replacement of all arguments, Arguments related to the Settings are the only one not possible to change via this config file. Having it enabled additionally gives access to another feature mentioned below
  • Mod Black List. Settings File exclusive feature, allowing to set file names that are going to be ignored in the verification and removal step. Really useful when working with Dev-Only version of the mod, or for beta testers to add mods like Rubidium!
  • Hash and FileSize Verification. Pretty much the main reason to replace InstanceSync. Old app was just downloading files from the links, without actually verifying downloads. CDL has FileSize verification, and SHA-512 based Hash Verification
  • Updater. Not much else to explain here, Automatic updates when new release is out!
  • NOT A FEATURE - Executors thread and download attempts. Those are 2 config values that can be also changed, default is 16 Java threads and 5 download attemps.

Few notes:

  • The configuration is pretty much default one, that worked pretty well for both of my machines, however I have pretty fast network connection (syncing entire E9 profile in under 7 seconds) so if I have to edit default values to be a bit lower, just mention that :D
  • Scripts were meant to be left like that, however I'm working on a small additional feature meant to check if Settings file is already generated, to not re-generate it all the time, instead of doing additional scripts for just launching the app.
    This will allow to preserve blacklist and custom settings if someone decides to change them on their own.
    Finished!
  • Yes, this had a complete rewrite, both the app and this PR comment😄 The app rewrite was done however some time ago, so this is just a funfact!

@Kanzaji Kanzaji marked this pull request as ready for review August 23, 2023 09:05
@Darkere
Copy link

Darkere commented Aug 23, 2023

Does this work on linux and from pure commandline?

@Kanzaji
Copy link
Contributor Author

Kanzaji commented Aug 23, 2023

souliboi from our server tested the app out on Linux, and it appears to work fine there as well :D
And yes, if you want to, the app can be configured to not create any files except mod files, redirecting logger output to the console, and using default values for the configuration options (or any that are put in the arguments)

java -jar Cat-Downloader-Legacy.jar -Settings:false -Logger:false will launch the app without creating log file nor Settings file :D (If that is what you meant by pure commandline)

@Souliboi
Copy link

Souliboi commented Aug 23, 2023

sips tea
image
Cat-Downloader.log

the vim command was just to verify the stock settings applied, kanz might want to change the commented section for the modes to be appropriate if the modes are case-sensitive so people know exactly what to enter

oh yeah and my java path wasn't actually set so dw about me having to manually dig out the binary, a script can probably handle that much better.

@Kanzaji
Copy link
Contributor Author

Kanzaji commented Aug 23, 2023

Yea they were meant to be case-insensitive, however I forgot to lower-case them when I save them to the ARD... so thats a thing I need to fix 😅

@NielsPilgaard NielsPilgaard added the Development Applying this to an issue will not add it to changelogs, as opposed to the Enhancement label. label Aug 23, 2023
@NielsPilgaard
Copy link
Contributor

I've been thinking about this change, and I've come to the conclusion that I don't want to break people's existing instance sync setups by introducing it now. I'd like to wait until the next Enigmatica modpack.

We're keeping this PR open for anyone who wants to make the switch to CDL themselves.

@Lgmrszd
Copy link
Contributor

Lgmrszd commented Apr 23, 2024

I'll ask here since it's related: was usage of tools such as packwiz has been considered for future modpacks? It works in command line and supports CF export, as well as auto-updating instances in PrismLauncher / MultiMC. Unfortunately though it might not work with CF app.

Edit: FYI, two major advantages of packwiz that I think are important are, ability to add/update/remove mods from the pack (my understanding is that with InstanceSync, this is only possible when using Official CurseForge launcher), and a better structure of pack file, which is easier to check when simply viewing it and it makes sensible diffs in git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development Applying this to an issue will not add it to changelogs, as opposed to the Enhancement label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants