diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-04-13 23:06:28 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-04-13 23:06:28 +0200 |
commit | b6d7ffab477cbd7d6c49c4c16ec1de615279e7ef (patch) | |
tree | c572081aac9af42a41e23ac229f3ade4ed0bb221 /logic/OneSixUpdate.cpp | |
parent | 04b36a3e55f8dedf9f0a4992c4347a21131b4176 (diff) | |
download | MultiMC-b6d7ffab477cbd7d6c49c4c16ec1de615279e7ef.tar MultiMC-b6d7ffab477cbd7d6c49c4c16ec1de615279e7ef.tar.gz MultiMC-b6d7ffab477cbd7d6c49c4c16ec1de615279e7ef.tar.lz MultiMC-b6d7ffab477cbd7d6c49c4c16ec1de615279e7ef.tar.xz MultiMC-b6d7ffab477cbd7d6c49c4c16ec1de615279e7ef.zip |
Detect and report missing local libraries.
Diffstat (limited to 'logic/OneSixUpdate.cpp')
-rw-r--r-- | logic/OneSixUpdate.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp index cddd0def..27bc415f 100644 --- a/logic/OneSixUpdate.cpp +++ b/logic/OneSixUpdate.cpp @@ -268,10 +268,16 @@ void OneSixUpdate::jarlibStart() auto metacache = MMC->metacache(); QList<ForgeXzDownloadPtr> ForgeLibs; + QList<std::shared_ptr<OneSixLibrary>> brokenLocalLibs; + for (auto lib : libs) { if (lib->hint() == "local") + { + if(!lib->filesExist()) + brokenLocalLibs.append(lib); continue; + } QString raw_storage = lib->storagePath(); QString raw_dl = lib->downloadUrl(); @@ -305,6 +311,18 @@ void OneSixUpdate::jarlibStart() f(raw_storage, raw_dl); } } + if(!brokenLocalLibs.empty()) + { + jarlibDownloadJob.reset(); + QStringList failed; + for(auto brokenLib : brokenLocalLibs) + { + failed.append(brokenLib->files()); + } + QString failed_all = failed.join("\n"); + emitFailed(tr("Some libraries marked as 'local' are missing their jar files:\n%1\n\nYou'll have to correct this problem manually. If this is an externally tracked instance, make sure to run it at least once outside of MultiMC.").arg(failed_all)); + return; + } // TODO: think about how to propagate this from the original json file... or IF AT ALL QString forgeMirrorList = "http://files.minecraftforge.net/mirror-brand.list"; if (!ForgeLibs.empty()) |