Repository navigation
Conversation
d0a41ae to
cc4cded
Compare
|
Couldn't we achieve the same goal by keeping the current behavior and caching modpack content instead? |
+++ ed: stupid fucking idiot, absolute bafoon |
uhh, my bad English makes me do not completely understand your lines. The behavior of this pr is: I add one dialog when abort download or the download was aborted by bad networks, If choose "Yes" meaning keeping the content we have downloaded, then the modpack will be cached and one new instance was also created. If choose "No", the content was dropped, just behave like recent. So does the line above meaning, uhh, like defaultly keeping the modpack cache and create one new instance ? Just tell me more details |
He was saying that the solution to the problem might be more simple - just keep the downloaded modpack files in a shared cache folder. if something failed, the cached modpack files will be still present, and following retries will download only those files that are absent from cache |
probably need to clarify as well these things:
|
|
Then I get. Thanks a lot |
|
some more details needs discuss below: Where to keep the files already downloaded? Typically when install one mod pack, there will be modpack files(almost be downloaded from one single archive, and unzip, this will always keep stable), download mod files. The game sources download have already been cached.So what we care is the mod downloaded. In recent implement, I record one another manifest cut from the modpack mainfest, then the download will always be started if the files in the cut json do not be done. the downloaded mod files will directly send to the modpack instance's mods folder. One more thing, if my understanding is right, after any abort of the modpack installation, there will always be one new instance?(so users can decide whether to delete) Or manage one another cache folder for the aborted instance? I do not suggest the second because we must control how to clean the cache, when to clean the cache and if the user restart the installation, we need check whether it's continuation or new installation, and even so more(but if it's better for the project, I will try my best). |
134a550 to
74906d1
Compare
|
Sorry for the delay!
This can be done using
No, I'd like to keep the existing behavior, so if an error occurs or the user aborts the installation, no instance is created. |
get it |
c4fb495 to
ee368d5
Compare
|
I've revised the behavior discussed above. Downloaded files are now cached through HttpMetaCache. The dialog was been removed. This currently covers Modrinth and CurseForge. I plan to support the other platformsin follow-up changes. There's one other point I'd like to discuss: HttpMetaCache doesn't appear to automatically reclaim disk space. If a user cancels a modpack installation and never retries it, the downloaded files could remain in the cache indefinitely. Would it make sense to periodically remove cached files that haven't been used for a long time? Since these files can be shared across modpacks, this would probably be better handled at the cache level rather than per modpack. |
|
yes. would be good to make this period as value option in settings |
@so5iso4ka I may not do this in this pr. I think it should be taken in consideration |
db272de to
cfdb4f8
Compare
|
I've add all platform modpack download cache feature ready for review @so5iso4ka |
There was a problem hiding this comment.
Why implement such major changes when we could just add caching to the existing tasks?
For example, in ModrinthCreationTask this:
auto dl = Net::ApiDownload::makeFile(downloadUrl, filePath, Net::Download::Option::NoOptions, meta);
dl->addValidator(new Net::ChecksumValidator(file.hashAlgorithm, file.hash));could become something like:
(pseudocode)
auto entry = APPLICATION->metacache()->resolveEntry("general", "modpack-files/" + file.hash.toHex());
auto dl = Net::ApiDownload::makeCached(downloadUrl, entry, Net::Download::Option::MakeEternal, meta);
dl->addValidator(new Net::ChecksumValidator(file.hashAlgorithm, file.hash));
// after
FS::copy(entry->getFullPath(), filePath)();Or maybe better: something like MetaCacheSink, but with the target file name separated from the cache key, so it copies the cached file to the target path itself.
|
That's OK. I would like to explain the changes first. In the first version I changed the instance creation process, and here:
Meanwhile these repacked codes is convinient for me to do local unit tests. So there's such a big changes. That's my fault, feeling sorry. Next version I will try to implement MetaCacheSink. It may take me some time. |
27bd897 to
292e4da
Compare
Distinguish network failures from local and parsing errors, clear stale replies on retries, and close canceled sinks before completion. Cover retry followed by local failure using real loopback networking. Assisted-by: OpenCode:gpt-6.1-sol-fast Signed-off-by: HowXu <dev@howxu.cn>
Add the default-off automatic keep setting and shared creation handling. Preserve supported new instances after content interruption or game dependency network failure without changing Skip. Assisted-by: OpenCode:gpt-6.1-sol-fast Signed-off-by: HowXu <dev@howxu.cn>
Share content installation between creation and resume, retain native pending entries, reuse validated files, and drain writes before a keep decision. Assisted-by: OpenCode:gpt-6.1-sol-fast Signed-off-by: HowXu <dev@howxu.cn>
Resolve remaining native IDs, retain interrupted downloads, validate manual files and resource processing, and rollback uncommitted worlds safely. Assisted-by: OpenCode:gpt-6.1-sol-fast Signed-off-by: HowXu <dev@howxu.cn>
Resume content before normal launch steps, reject explicit offline launches with pending content, and remove markers only after successful completion. Assisted-by: OpenCode:gpt-6.1-sol-fast Signed-off-by: HowXu <dev@howxu.cn>
Keep successful requests without a valid landed file pending for fallback URLs, and verify SHA-512 before optional cleanup or manifest filtering. Assisted-by: OpenCode:gpt-6.1-sol-fast Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
…fault action Signed-off-by: HowXu <dev@howxu.cn>
Reuse HttpMetaCache for verified Modrinth and CurseForge content, copying cached files into staging while preserving optional files, fallback URLs and manual resource installation. Remove incomplete-instance persistence and launch-time recovery. Keep the game-file Skip behavior and wait for content downloads to stop before staging cleanup. Add cache reuse and cancellation tests. Assisted-by: Pi:gpt-6.1-sol Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Reuse HttpMetaCache for hashed ATLauncher mods and configs, FTB downloads and Technic Solder archives. Preserve existing download paths when usable hashes are unavailable and retain FTB's single-request limit. Keep multiple ATLauncher installation targets for shared cache entries. Add focused platform-cache tests and remove stale registrations for previously deleted tests. Assisted-by: Pi:gpt-6.1-sol Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
…eta cache Signed-off-by: HowXu <dev@howxu.cn>
Assisted-by: Pi:gpt-6.1-sol Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
Assisted-by: Pi:gpt-6.1-sol Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
…m codes Signed-off-by: HowXu <dev@howxu.cn>
Signed-off-by: HowXu <dev@howxu.cn>
74330cf to
a966505
Compare
|
@so5iso4ka much better now. ready for review Just tell me the lacks. I am a long time user of Freesm and I hope my code will improve it too |
Summary
from #206 , which discusses some features for the users who do not have a good networks or for the situation that network not work well
This PR adds resumable installation for Modrinth and CurseForge modpacks, helping users avoid downloading completed files again when their connection is unreliable. And one new global setting, disabled by default, lets users keep incomplete instances automatically without dialog. Choosing not to keep the instance preserves the existing cleanup behavior.
Large scope changes
This feature involves one large scope of adjustment in launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp and launcher/modplatform/flame/FlameInstanceCreationTask.cpp. I move the core download functions to the XXXInstallTask.cpp. I think if there is one class named XXXInstallTask, it should contains the code about download (but they are in the XXXInstanceCreationTask). Meanwhile, the download codes will be reused in the resume task.
If it's not suitable for the project, just tell me and I will do the modification
Test
Some simple tests
Manual testing of Modrinth and CurseForge installation and recovery was performed on Kali Linux, kernel 7.0.12, using Wayland with niri.
Keep
Unfortunately, this feature only implement for modrinth and curseforge modpack. other platforms are outside the scope of this PR. Platforms such as FTB, ATLauncher, and Technic use different manifests or installation workflows and require separate adaptations.