Smart Updating/Downloading, Has it been done yet or not?

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

DuBCraft21

New Member
Jul 29, 2019
3
0
0
I was wondering if anyone knows if this feature has been added yet or not. I have a good idea of how to implement it if it hasn't been added yet, so if it hasn't then if I have the time I might just try implement it myself since I am competent with my programming skills in java. I don't want to waist my time if it already has been implemented though... (I have found the source code at https://github.com/Slowpoke101/FTBLaunch)

Thanks for letting me know in advance!

For those who don't know what I mean by "Smart Updating/Downloading" it just means that if you are downloading a modpack and you already have the right version of a particular mod downloaded then it will just copy it instead of downloading or if you are updating it will only update the mods that need to be updated.
 

Scottly318

New Member
Jul 29, 2019
797
0
0
With ftb moving to the curse launcher in time, my guess is even if this isn't a feature I wouldn't count on it being added. @jikuja can correct me if I'm wrong. Which I frequently am :p
 

DuBCraft21

New Member
Jul 29, 2019
3
0
0
the way I was thinking about adding it turns out to be a lot harder than I initially thought. It had been a long time since I looked at the source code for the launcher and I didnt remember how it worked entirely. After rereading the code it appears that the hole download system would need to be reworked.

The way I thought it worked was it would grabbing each file separately, but looking over the code again, that is clearly not what this does: (I modified it to take up a little less space without changing any functionality at all)
while ((readLen = input.read(buffer, 0, buffer.length)) != -1) {//from net.ftb.download.workers.AssetDownloader
output.write(buffer, 0, readLen);
currentSize += readLen;
int prog = (int) ((currentSize / remoteSize) * 100);
if (prog > 100) prog = 100;
if (prog < 0) prog = 0;
setProgress(prog);
prog = (progressIndex * 100) + prog;
setReady(prog);
}​

In order to implement what I was thinking the download would need to be separated into either the bulk parts that stay almost the same and the mods/config as well as anything else that changes a lot from pack to pack or just to break the hole pack down into its component parts and download each part as its own entity. On the client side a file could be created that holds the locations of all currently installed mods on the system as well as a hash. With this it would be possible to grab the names and hashes of the files that need to be downloaded which can be checked against the file that contains all installed mods so the existing ones can be copied and only the new ones would be downloaded from the server. Updating could be handled in a very similar way as well.

Sorry if my explanation was a little hard to follow, I am very tired.

edit: @jikuja I am not sure of you have seen this or not, but if you haven't then maybe this will make it show up for you... I dont know much about how this forum works...
 
Last edited: