mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-28 15:18:21 +00:00
NOISSUE Verify file checksums for modpacks.ch
This commit is contained in:
parent
dc3a4cebce
commit
f51efc9109
@ -5,6 +5,7 @@
|
|||||||
#include "Json.h"
|
#include "Json.h"
|
||||||
#include "minecraft/MinecraftInstance.h"
|
#include "minecraft/MinecraftInstance.h"
|
||||||
#include "minecraft/PackProfile.h"
|
#include "minecraft/PackProfile.h"
|
||||||
|
#include "net/ChecksumValidator.h"
|
||||||
#include "settings/INISettingsObject.h"
|
#include "settings/INISettingsObject.h"
|
||||||
|
|
||||||
namespace ModpacksCH {
|
namespace ModpacksCH {
|
||||||
@ -98,6 +99,10 @@ void PackInstallTask::downloadPack()
|
|||||||
|
|
||||||
qDebug() << "Will download" << file.url << "to" << path;
|
qDebug() << "Will download" << file.url << "to" << path;
|
||||||
auto dl = Net::Download::makeFile(file.url, path);
|
auto dl = Net::Download::makeFile(file.url, path);
|
||||||
|
if (!file.sha1.isEmpty()) {
|
||||||
|
auto rawSha1 = QByteArray::fromHex(file.sha1.toLatin1());
|
||||||
|
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
|
||||||
|
}
|
||||||
jobPtr->addNetAction(dl);
|
jobPtr->addNetAction(dl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user