From 8a7f1e405f0ac57adcff455d5ca00a5f08f10868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 4 Nov 2018 13:41:21 +0100 Subject: [PATCH] NOISSUE take forge xz download url base from the metadata file Instead of hardcoding it. --- api/logic/minecraft/Library.cpp | 2 +- api/logic/minecraft/forge/ForgeXzDownload.cpp | 4 ++-- api/logic/minecraft/forge/ForgeXzDownload.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/logic/minecraft/Library.cpp b/api/logic/minecraft/Library.cpp index 8a0d8747..1cd6abb5 100644 --- a/api/logic/minecraft/Library.cpp +++ b/api/logic/minecraft/Library.cpp @@ -105,7 +105,7 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class if (isForge) { qDebug() << "XzDownload for:" << rawName() << "storage:" << storage << "url:" << url; - out.append(ForgeXzDownload::make(storage, entry)); + out.append(ForgeXzDownload::make(url, storage, entry)); } else { diff --git a/api/logic/minecraft/forge/ForgeXzDownload.cpp b/api/logic/minecraft/forge/ForgeXzDownload.cpp index ea968835..9f5dcf84 100644 --- a/api/logic/minecraft/forge/ForgeXzDownload.cpp +++ b/api/logic/minecraft/forge/ForgeXzDownload.cpp @@ -23,14 +23,14 @@ #include #include -ForgeXzDownload::ForgeXzDownload(QString relative_path, MetaEntryPtr entry) : NetAction() +ForgeXzDownload::ForgeXzDownload(QString url, QString relative_path, MetaEntryPtr entry) : NetAction() { m_entry = entry; m_target_path = entry->getFullPath(); m_pack200_xz_file.setFileTemplate("./dl_temp.XXXXXX"); m_status = Job_NotStarted; m_url_path = relative_path; - m_url = "https://files.minecraftforge.net/maven/" + m_url_path + ".pack.xz"; + m_url = url + ".pack.xz"; } void ForgeXzDownload::start() diff --git a/api/logic/minecraft/forge/ForgeXzDownload.h b/api/logic/minecraft/forge/ForgeXzDownload.h index 728a7f7a..1ff7df97 100644 --- a/api/logic/minecraft/forge/ForgeXzDownload.h +++ b/api/logic/minecraft/forge/ForgeXzDownload.h @@ -35,10 +35,10 @@ public: QString m_url_path; public: - explicit ForgeXzDownload(QString relative_path, MetaEntryPtr entry); - static ForgeXzDownloadPtr make(QString relative_path, MetaEntryPtr entry) + explicit ForgeXzDownload(QString url, QString relative_path, MetaEntryPtr entry); + static ForgeXzDownloadPtr make(QString url, QString relative_path, MetaEntryPtr entry) { - return ForgeXzDownloadPtr(new ForgeXzDownload(relative_path, entry)); + return ForgeXzDownloadPtr(new ForgeXzDownload(url, relative_path, entry)); } virtual ~ForgeXzDownload(){}; bool canAbort() override;