summaryrefslogtreecommitdiffstats
path: root/logic/OneSixUpdate.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-24 06:36:16 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-24 06:36:16 +0100
commitca297fca79a7b1b96e41ba5abed4956af9383c16 (patch)
tree5c6cf2a486c4015f5e52842acb412e39b8498acd /logic/OneSixUpdate.cpp
parent4124faf474908e4d79d93b0f624bf8fd81bd9972 (diff)
downloadMultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.tar
MultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.tar.gz
MultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.tar.lz
MultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.tar.xz
MultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.zip
Prepare for rework of instance launch/update
Added missing licenses Added a Java functionality checker (detects 32/64bit java) Refactor of *Update - no longer based on BaseUpdate, but Task directly Fixed runner script to not derp up on 32bit linux. Could add more detection and error reporting there. Resources are now split into graphics and generated. Generated resources are placed in the build tree and included from there. Used the Java checker in the main settings dialog (TODO: instance settings). Partial support for ${arch}-using libraries - both 32 and 64 variants of ${arch} are downloaded.
Diffstat (limited to 'logic/OneSixUpdate.cpp')
-rw-r--r--logic/OneSixUpdate.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp
index 62d95ee6..c69ff155 100644
--- a/logic/OneSixUpdate.cpp
+++ b/logic/OneSixUpdate.cpp
@@ -32,7 +32,7 @@
#include "pathutils.h"
-OneSixUpdate::OneSixUpdate(BaseInstance *inst, QObject *parent) : BaseUpdate(inst, parent)
+OneSixUpdate::OneSixUpdate(BaseInstance *inst, QObject *parent) : Task(parent), m_inst(inst)
{
}
@@ -143,7 +143,7 @@ void OneSixUpdate::jarlibStart()
bool successful = inst->reloadFullVersion();
if (!successful)
{
- emitFailed("Failed to load the version description file (version.json). It might be "
+ emitFailed("Failed to load the version description file. It might be "
"corrupted, missing or simply too new.");
return;
}
@@ -170,16 +170,36 @@ void OneSixUpdate::jarlibStart()
{
if (lib->hint() == "local")
continue;
- auto entry = metacache->resolveEntry("libraries", lib->storagePath());
+ QString storage = lib->storagePath();
+ QString dl = lib->downloadUrl();
+ if (lib->isNative() && storage.contains("${arch}"))
+ {
+ auto storage64 = storage, storage32 = storage;
+ auto dl64 = dl, dl32 = dl;
+ storage64.replace("${arch}", "64");
+ storage32.replace("${arch}", "32");
+ dl32.replace("${arch}", "32");
+ dl64.replace("${arch}", "64");
+
+ auto entry64 = metacache->resolveEntry("libraries", storage64);
+ if (entry64->stale)
+ jarlibDownloadJob->addNetAction(CacheDownload::make(dl64, entry64));
+
+ auto entry32 = metacache->resolveEntry("libraries", storage32);
+ if (entry32->stale)
+ jarlibDownloadJob->addNetAction(CacheDownload::make(dl32, entry32));
+ continue;
+ }
+ auto entry = metacache->resolveEntry("libraries", storage);
if (entry->stale)
{
if (lib->hint() == "forge-pack-xz")
{
- ForgeLibs.append(ForgeXzDownload::make(lib->storagePath(), entry));
+ ForgeLibs.append(ForgeXzDownload::make(storage, entry));
}
else
{
- jarlibDownloadJob->addNetAction(CacheDownload::make(lib->downloadUrl(), entry));
+ jarlibDownloadJob->addNetAction(CacheDownload::make(dl, entry));
}
}
}