aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/technic
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-09-28 22:50:12 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-09-28 22:50:12 +0300
commit9acbf98f940204cd141203a6eccbc9a7351e5a78 (patch)
tree6ac8fe4b0e51ee58c67e02783fe97b00de707167 /launcher/modplatform/technic
parent254444470f020b086648ac496ebfffb7d3e9ce05 (diff)
parent59e565ef96b85be9a25fa5d4f1723ee87fd5e75e (diff)
downloadPrismLauncher-9acbf98f940204cd141203a6eccbc9a7351e5a78.tar.gz
PrismLauncher-9acbf98f940204cd141203a6eccbc9a7351e5a78.tar.bz2
PrismLauncher-9acbf98f940204cd141203a6eccbc9a7351e5a78.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into feat/acknowledge_release_type
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/technic')
-rw-r--r--launcher/modplatform/technic/SingleZipPackInstallTask.cpp4
-rw-r--r--launcher/modplatform/technic/SolderPackInstallTask.cpp5
-rw-r--r--launcher/modplatform/technic/TechnicPackProcessor.cpp10
3 files changed, 11 insertions, 8 deletions
diff --git a/launcher/modplatform/technic/SingleZipPackInstallTask.cpp b/launcher/modplatform/technic/SingleZipPackInstallTask.cpp
index dd59e652..ad08d72d 100644
--- a/launcher/modplatform/technic/SingleZipPackInstallTask.cpp
+++ b/launcher/modplatform/technic/SingleZipPackInstallTask.cpp
@@ -23,6 +23,8 @@
#include "Application.h"
+#include "net/ApiDownload.h"
+
Technic::SingleZipPackInstallTask::SingleZipPackInstallTask(const QUrl& sourceUrl, const QString& minecraftVersion)
{
m_sourceUrl = sourceUrl;
@@ -45,7 +47,7 @@ void Technic::SingleZipPackInstallTask::executeTask()
auto entry = APPLICATION->metacache()->resolveEntry("general", path);
entry->setStale(true);
m_filesNetJob.reset(new NetJob(tr("Modpack download"), APPLICATION->network()));
- m_filesNetJob->addNetAction(Net::Download::makeCached(m_sourceUrl, entry));
+ m_filesNetJob->addNetAction(Net::ApiDownload::makeCached(m_sourceUrl, entry));
m_archivePath = entry->getFullPath();
auto job = m_filesNetJob.get();
connect(job, &NetJob::succeeded, this, &Technic::SingleZipPackInstallTask::downloadSucceeded);
diff --git a/launcher/modplatform/technic/SolderPackInstallTask.cpp b/launcher/modplatform/technic/SolderPackInstallTask.cpp
index ad564de0..c162d625 100644
--- a/launcher/modplatform/technic/SolderPackInstallTask.cpp
+++ b/launcher/modplatform/technic/SolderPackInstallTask.cpp
@@ -42,6 +42,7 @@
#include "SolderPackManifest.h"
#include "TechnicPackProcessor.h"
+#include "net/ApiDownload.h"
#include "net/ChecksumValidator.h"
Technic::SolderPackInstallTask::SolderPackInstallTask(shared_qobject_ptr<QNetworkAccessManager> network,
@@ -71,7 +72,7 @@ void Technic::SolderPackInstallTask::executeTask()
m_filesNetJob.reset(new NetJob(tr("Resolving modpack files"), m_network));
auto sourceUrl = QString("%1/modpack/%2/%3").arg(m_solderUrl.toString(), m_pack, m_version);
- m_filesNetJob->addNetAction(Net::Download::makeByteArray(sourceUrl, m_response));
+ m_filesNetJob->addNetAction(Net::ApiDownload::makeByteArray(sourceUrl, m_response));
auto job = m_filesNetJob.get();
connect(job, &NetJob::succeeded, this, &Technic::SolderPackInstallTask::fileListSucceeded);
@@ -111,7 +112,7 @@ void Technic::SolderPackInstallTask::fileListSucceeded()
for (const auto& mod : build.mods) {
auto path = FS::PathCombine(m_outputDir.path(), QString("%1").arg(i));
- auto dl = Net::Download::makeFile(mod.url, path);
+ auto dl = Net::ApiDownload::makeFile(mod.url, path);
if (!mod.md5.isEmpty()) {
auto rawMd5 = QByteArray::fromHex(mod.md5.toLatin1());
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Md5, rawMd5));
diff --git a/launcher/modplatform/technic/TechnicPackProcessor.cpp b/launcher/modplatform/technic/TechnicPackProcessor.cpp
index 778a6531..3b9424bf 100644
--- a/launcher/modplatform/technic/TechnicPackProcessor.cpp
+++ b/launcher/modplatform/technic/TechnicPackProcessor.cpp
@@ -31,7 +31,7 @@ void Technic::TechnicPackProcessor::run(SettingsObjectPtr globalSettings,
const QString& instIcon,
const QString& stagingPath,
const QString& minecraftVersion,
- const bool isSolder)
+ [[maybe_unused]] const bool isSolder)
{
QString minecraftPath = FS::PathCombine(stagingPath, ".minecraft");
QString configPath = FS::PathCombine(stagingPath, "instance.cfg");
@@ -138,15 +138,15 @@ void Technic::TechnicPackProcessor::run(SettingsObjectPtr globalSettings,
try {
QJsonDocument doc = Json::requireDocument(data);
QJsonObject root = Json::requireObject(doc, "version.json");
- QString minecraftVersion = Json::ensureString(root, "inheritsFrom", QString(), "");
- if (minecraftVersion.isEmpty()) {
+ QString packMinecraftVersion = Json::ensureString(root, "inheritsFrom", QString(), "");
+ if (packMinecraftVersion.isEmpty()) {
if (fmlMinecraftVersion.isEmpty()) {
emit failed(tr("Could not understand \"version.json\":\ninheritsFrom is missing"));
return;
}
- minecraftVersion = fmlMinecraftVersion;
+ packMinecraftVersion = fmlMinecraftVersion;
}
- components->setComponentVersion("net.minecraft", minecraftVersion, true);
+ components->setComponentVersion("net.minecraft", packMinecraftVersion, true);
for (auto library : Json::ensureArray(root, "libraries", {})) {
if (!library.isObject()) {
continue;