diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-04-23 02:27:40 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-09 01:38:29 +0200 |
commit | aade36860c373268857ca821c14a13f38c880b1a (patch) | |
tree | 464b804216c7eadc00941daa33a1713c8071a088 /logic | |
parent | 3a0cdf2d3dde6192694ca34429ab277608357c2a (diff) | |
download | MultiMC-aade36860c373268857ca821c14a13f38c880b1a.tar MultiMC-aade36860c373268857ca821c14a13f38c880b1a.tar.gz MultiMC-aade36860c373268857ca821c14a13f38c880b1a.tar.lz MultiMC-aade36860c373268857ca821c14a13f38c880b1a.tar.xz MultiMC-aade36860c373268857ca821c14a13f38c880b1a.zip |
Begin the transformation!
Nuke all the things.
Diffstat (limited to 'logic')
-rw-r--r-- | logic/BaseInstaller.h | 2 | ||||
-rw-r--r-- | logic/BaseVersion.h | 4 | ||||
-rw-r--r-- | logic/InstanceFactory.cpp | 52 | ||||
-rw-r--r-- | logic/LegacyInstance.cpp | 11 | ||||
-rw-r--r-- | logic/LegacyUpdate.cpp | 65 | ||||
-rw-r--r-- | logic/LegacyUpdate.h | 9 | ||||
-rw-r--r-- | logic/MinecraftVersion.h | 45 | ||||
-rw-r--r-- | logic/NostalgiaInstance.cpp | 36 | ||||
-rw-r--r-- | logic/NostalgiaInstance.h | 29 | ||||
-rw-r--r-- | logic/OneSixFTBInstance.cpp | 4 | ||||
-rw-r--r-- | logic/OneSixInstance.cpp | 64 | ||||
-rw-r--r-- | logic/OneSixInstance.h | 11 | ||||
-rw-r--r-- | logic/OneSixInstance_p.h | 3 | ||||
-rw-r--r-- | logic/OneSixLibrary.h | 2 | ||||
-rw-r--r-- | logic/OneSixUpdate.cpp | 2 | ||||
-rw-r--r-- | logic/OneSixVersionBuilder.cpp | 10 | ||||
-rw-r--r-- | logic/OneSixVersionBuilder.h | 5 | ||||
-rw-r--r-- | logic/VersionFile.cpp | 84 | ||||
-rw-r--r-- | logic/VersionFile.h | 19 | ||||
-rw-r--r-- | logic/VersionFinal.cpp | 75 | ||||
-rw-r--r-- | logic/VersionFinal.h | 32 | ||||
-rw-r--r-- | logic/forge/ForgeData.cpp | 62 | ||||
-rw-r--r-- | logic/forge/ForgeData.h | 21 | ||||
-rw-r--r-- | logic/forge/ForgeInstaller.cpp (renamed from logic/ForgeInstaller.cpp) | 180 | ||||
-rw-r--r-- | logic/forge/ForgeInstaller.h (renamed from logic/ForgeInstaller.h) | 20 | ||||
-rw-r--r-- | logic/forge/ForgeMirror.h (renamed from logic/net/ForgeMirror.h) | 0 | ||||
-rw-r--r-- | logic/forge/ForgeMirrors.cpp (renamed from logic/net/ForgeMirrors.cpp) | 0 | ||||
-rw-r--r-- | logic/forge/ForgeMirrors.h (renamed from logic/net/ForgeMirrors.h) | 8 | ||||
-rw-r--r-- | logic/forge/ForgeVersion.cpp | 55 | ||||
-rw-r--r-- | logic/forge/ForgeVersion.h | 31 | ||||
-rw-r--r-- | logic/forge/ForgeVersionList.cpp (renamed from logic/lists/ForgeVersionList.cpp) | 26 | ||||
-rw-r--r-- | logic/forge/ForgeVersionList.h (renamed from logic/lists/ForgeVersionList.h) | 51 | ||||
-rw-r--r-- | logic/forge/ForgeXzDownload.cpp (renamed from logic/net/ForgeXzDownload.cpp) | 0 | ||||
-rw-r--r-- | logic/forge/ForgeXzDownload.h (renamed from logic/net/ForgeXzDownload.h) | 4 | ||||
-rw-r--r-- | logic/forge/LegacyForge.cpp (renamed from logic/LegacyForge.cpp) | 0 | ||||
-rw-r--r-- | logic/forge/LegacyForge.h (renamed from logic/LegacyForge.h) | 2 | ||||
-rw-r--r-- | logic/lists/MinecraftVersionList.cpp | 16 | ||||
-rw-r--r-- | logic/liteloader/LiteLoaderInstaller.cpp (renamed from logic/LiteLoaderInstaller.cpp) | 8 | ||||
-rw-r--r-- | logic/liteloader/LiteLoaderInstaller.h (renamed from logic/LiteLoaderInstaller.h) | 5 | ||||
-rw-r--r-- | logic/liteloader/LiteLoaderVersionList.cpp (renamed from logic/lists/LiteLoaderVersionList.cpp) | 0 | ||||
-rw-r--r-- | logic/liteloader/LiteLoaderVersionList.h (renamed from logic/lists/LiteLoaderVersionList.h) | 4 | ||||
-rw-r--r-- | logic/net/NetJob.h | 2 |
42 files changed, 616 insertions, 443 deletions
diff --git a/logic/BaseInstaller.h b/logic/BaseInstaller.h index d59833cc..9531fbff 100644 --- a/logic/BaseInstaller.h +++ b/logic/BaseInstaller.h @@ -29,7 +29,7 @@ class BaseInstaller { public: BaseInstaller(); - + virtual ~BaseInstaller(){}; bool isApplied(OneSixInstance *on); virtual bool add(OneSixInstance *to); diff --git a/logic/BaseVersion.h b/logic/BaseVersion.h index 43f5942a..ed63f551 100644 --- a/logic/BaseVersion.h +++ b/logic/BaseVersion.h @@ -16,6 +16,8 @@ #pragma once #include <memory> +#include <QString> +#include <QMetaType> /*! * An abstract base class for versions. @@ -52,4 +54,4 @@ struct BaseVersion typedef std::shared_ptr<BaseVersion> BaseVersionPtr; -Q_DECLARE_METATYPE(BaseVersionPtr)
\ No newline at end of file +Q_DECLARE_METATYPE(BaseVersionPtr) diff --git a/logic/InstanceFactory.cpp b/logic/InstanceFactory.cpp index 95fd855b..955a3f5b 100644 --- a/logic/InstanceFactory.cpp +++ b/logic/InstanceFactory.cpp @@ -23,7 +23,6 @@ #include "LegacyFTBInstance.h" #include "OneSixInstance.h" #include "OneSixFTBInstance.h" -#include "NostalgiaInstance.h" #include "OneSixInstance.h" #include "BaseVersion.h" #include "MinecraftVersion.h" @@ -51,7 +50,7 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(InstancePtr &inst, QString inst_type = m_settings->get("InstanceType").toString(); // FIXME: replace with a map lookup, where instance classes register their types - if (inst_type == "OneSix") + if (inst_type == "OneSix" || inst_type == "Nostalgia") { inst.reset(new OneSixInstance(instDir, m_settings, this)); } @@ -59,10 +58,6 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(InstancePtr &inst, { inst.reset(new LegacyInstance(instDir, m_settings, this)); } - else if (inst_type == "Nostalgia") - { - inst.reset(new NostalgiaInstance(instDir, m_settings, this)); - } else if (inst_type == "LegacyFTB") { inst.reset(new LegacyFTBInstance(instDir, m_settings, this)); @@ -98,55 +93,26 @@ InstanceFactory::InstCreateError InstanceFactory::createInstance(InstancePtr &in if (type == NormalInst) { - switch (mcVer->type) - { - case MinecraftVersion::Legacy: - // TODO new instance type - m_settings->set("InstanceType", "Legacy"); - inst.reset(new LegacyInstance(instDir, m_settings, this)); - inst->setIntendedVersionId(version->descriptor()); - inst->setShouldUseCustomBaseJar(false); - break; - case MinecraftVersion::OneSix: - m_settings->set("InstanceType", "OneSix"); - inst.reset(new OneSixInstance(instDir, m_settings, this)); - inst->setIntendedVersionId(version->descriptor()); - inst->setShouldUseCustomBaseJar(false); - break; - case MinecraftVersion::Nostalgia: - m_settings->set("InstanceType", "Nostalgia"); - inst.reset(new NostalgiaInstance(instDir, m_settings, this)); - inst->setIntendedVersionId(version->descriptor()); - inst->setShouldUseCustomBaseJar(false); - break; - default: - { - delete m_settings; - return InstanceFactory::NoSuchVersion; - } - } + m_settings->set("InstanceType", "OneSix"); + inst.reset(new OneSixInstance(instDir, m_settings, this)); + inst->setIntendedVersionId(version->descriptor()); + inst->setShouldUseCustomBaseJar(false); } else if (type == FTBInstance) { - switch (mcVer->type) + if(mcVer->usesLegacyLauncher()) { - case MinecraftVersion::Legacy: m_settings->set("InstanceType", "LegacyFTB"); inst.reset(new LegacyFTBInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); - break; - case MinecraftVersion::OneSix: + } + else + { m_settings->set("InstanceType", "OneSixFTB"); inst.reset(new OneSixFTBInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); - break; - default: - { - delete m_settings; - return InstanceFactory::NoSuchVersion; - } } } else diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp index 6648e059..bc4d2cfc 100644 --- a/logic/LegacyInstance.cpp +++ b/logic/LegacyInstance.cpp @@ -29,8 +29,6 @@ #include "logic/LegacyUpdate.h" #include "logic/icons/IconList.h" -#include "gui/dialogs/LegacyModEditDialog.h" - LegacyInstance::LegacyInstance(const QString &rootDir, SettingsObject *settings, QObject *parent) : BaseInstance(new LegacyInstancePrivate(), rootDir, settings, parent) @@ -138,7 +136,7 @@ std::shared_ptr<ModList> LegacyInstance::texturePackList() QDialog *LegacyInstance::createModEditDialog(QWidget *parent) { - return new LegacyModEditDialog(this, parent); + return nullptr; } QString LegacyInstance::jarModsDir() const @@ -280,10 +278,7 @@ QString LegacyInstance::getStatusbarDescription() { if (flags().contains(VersionBrokenFlag)) { - return "Legacy : " + intendedVersionId() + " (broken)"; + return tr("Legacy : %1 (broken)").arg(intendedVersionId()); } - if (shouldUpdate()) - return "Legacy : " + currentVersionId() + " -> " + intendedVersionId(); - else - return "Legacy : " + currentVersionId(); + return tr("Legacy : %1").arg(intendedVersionId()); } diff --git a/logic/LegacyUpdate.cpp b/logic/LegacyUpdate.cpp index 15c99234..6816df40 100644 --- a/logic/LegacyUpdate.cpp +++ b/logic/LegacyUpdate.cpp @@ -30,52 +30,6 @@ LegacyUpdate::LegacyUpdate(BaseInstance *inst, QObject *parent) : Task(parent), m_inst(inst) { - // 1.3 - 1.3.2 - auto libs13 = QList<FMLlib>{ - {"argo-2.25.jar", "bb672829fde76cb163004752b86b0484bd0a7f4b", false}, - {"guava-12.0.1.jar", "b8e78b9af7bf45900e14c6f958486b6ca682195f", false}, - {"asm-all-4.0.jar", "98308890597acb64047f7e896638e0d98753ae82", false}}; - - fmlLibsMapping["1.3.2"] = libs13; - - auto libs14 = QList<FMLlib>{ - {"argo-2.25.jar", "bb672829fde76cb163004752b86b0484bd0a7f4b", false}, - {"guava-12.0.1.jar", "b8e78b9af7bf45900e14c6f958486b6ca682195f", false}, - {"asm-all-4.0.jar", "98308890597acb64047f7e896638e0d98753ae82", false}, - {"bcprov-jdk15on-147.jar", "b6f5d9926b0afbde9f4dbe3db88c5247be7794bb", false}}; - - fmlLibsMapping["1.4"] = libs14; - fmlLibsMapping["1.4.1"] = libs14; - fmlLibsMapping["1.4.2"] = libs14; - fmlLibsMapping["1.4.3"] = libs14; - fmlLibsMapping["1.4.4"] = libs14; - fmlLibsMapping["1.4.5"] = libs14; - fmlLibsMapping["1.4.6"] = libs14; - fmlLibsMapping["1.4.7"] = libs14; - - fmlLibsMapping["1.5"] = QList<FMLlib>{ - {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, - {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, - {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, - {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, - {"deobfuscation_data_1.5.zip", "5f7c142d53776f16304c0bbe10542014abad6af8", false}, - {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; - - fmlLibsMapping["1.5.1"] = QList<FMLlib>{ - {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, - {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, - {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, - {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, - {"deobfuscation_data_1.5.1.zip", "22e221a0d89516c1f721d6cab056a7e37471d0a6", false}, - {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; - - fmlLibsMapping["1.5.2"] = QList<FMLlib>{ - {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, - {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, - {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, - {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, - {"deobfuscation_data_1.5.2.zip", "446e55cd986582c70fcf12cb27bc00114c5adfd9", false}, - {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; } void LegacyUpdate::executeTask() @@ -110,6 +64,7 @@ void LegacyUpdate::fmllibsStart() bool forge_present = false; QString version = inst->intendedVersionId(); + auto & fmlLibsMapping = g_forgeData.fmlLibsMapping; if (!fmlLibsMapping.contains(version)) { lwjglStart(); @@ -152,7 +107,7 @@ void LegacyUpdate::fmllibsStart() // now check the lib folder inside the instance for files. for (auto &lib : libList) { - QFileInfo libInfo(PathCombine(inst->libDir(), lib.name)); + QFileInfo libInfo(PathCombine(inst->libDir(), lib.filename)); if (libInfo.exists()) continue; fmlLibsToProcess.append(lib); @@ -171,9 +126,9 @@ void LegacyUpdate::fmllibsStart() auto metacache = MMC->metacache(); for (auto &lib : fmlLibsToProcess) { - auto entry = metacache->resolveEntry("fmllibs", lib.name); - QString urlString = lib.ours ? URLConstants::FMLLIBS_OUR_BASE_URL + lib.name - : URLConstants::FMLLIBS_FORGE_BASE_URL + lib.name; + auto entry = metacache->resolveEntry("fmllibs", lib.filename); + QString urlString = lib.ours ? URLConstants::FMLLIBS_OUR_BASE_URL + lib.filename + : URLConstants::FMLLIBS_FORGE_BASE_URL + lib.filename; dljob->addNetAction(CacheDownload::make(QUrl(urlString), entry)); } @@ -196,16 +151,16 @@ void LegacyUpdate::fmllibsFinished() for (auto &lib : fmlLibsToProcess) { progress(index, fmlLibsToProcess.size()); - auto entry = metacache->resolveEntry("fmllibs", lib.name); - auto path = PathCombine(inst->libDir(), lib.name); + auto entry = metacache->resolveEntry("fmllibs", lib.filename); + auto path = PathCombine(inst->libDir(), lib.filename); if(!ensureFilePathExists(path)) { emitFailed(tr("Failed creating FML library folder inside the instance.")); return; } - if (!QFile::copy(entry->getFullPath(), PathCombine(inst->libDir(), lib.name))) + if (!QFile::copy(entry->getFullPath(), PathCombine(inst->libDir(), lib.filename))) { - emitFailed(tr("Failed copying Forge/FML library: %1.").arg(lib.name)); + emitFailed(tr("Failed copying Forge/FML library: %1.").arg(lib.filename)); return; } index++; @@ -265,8 +220,6 @@ void LegacyUpdate::lwjglStart() connect(rep, SIGNAL(downloadProgress(qint64, qint64)), SIGNAL(progress(qint64, qint64))); connect(worker.get(), SIGNAL(finished(QNetworkReply *)), SLOT(lwjglFinished(QNetworkReply *))); - // connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), - // SLOT(downloadError(QNetworkReply::NetworkError))); } void LegacyUpdate::lwjglFinished(QNetworkReply *reply) diff --git a/logic/LegacyUpdate.h b/logic/LegacyUpdate.h index 5b073cb7..1550ec34 100644 --- a/logic/LegacyUpdate.h +++ b/logic/LegacyUpdate.h @@ -21,19 +21,13 @@ #include "logic/net/NetJob.h" #include "logic/tasks/Task.h" +#include "logic/forge/ForgeData.h" class MinecraftVersion; class BaseInstance; class QuaZip; class Mod; -struct FMLlib -{ - QString name; - QString checksum; - bool ours; -}; - class LegacyUpdate : public Task { Q_OBJECT @@ -84,5 +78,4 @@ private: NetJobPtr legacyDownloadJob; BaseInstance *m_inst = nullptr; QList<FMLlib> fmlLibsToProcess; - QMap<QString, QList<FMLlib>> fmlLibsMapping; }; diff --git a/logic/MinecraftVersion.h b/logic/MinecraftVersion.h index 504381a8..6cbfebbe 100644 --- a/logic/MinecraftVersion.h +++ b/logic/MinecraftVersion.h @@ -17,6 +17,7 @@ #include "BaseVersion.h" #include <QStringList> +#include <QSet> struct MinecraftVersion : public BaseVersion { @@ -29,13 +30,8 @@ struct MinecraftVersion : public BaseVersion /// The URL that this version will be downloaded from. maybe. QString download_url; - /// This version's type. Used internally to identify what kind of version this is. - enum VersionType - { - OneSix, - Legacy, - Nostalgia - } type; + /// extra features enabled for this Minecraft version. Mostly for compatibility + QSet <QString> features; /// is this the latest version? bool is_latest = false; @@ -47,6 +43,11 @@ struct MinecraftVersion : public BaseVersion QString m_descriptor; + bool usesLegacyLauncher() + { + return features.contains("legacy"); + } + virtual QString descriptor() { return m_descriptor; @@ -59,31 +60,21 @@ struct MinecraftVersion : public BaseVersion virtual QString typeString() const { - QStringList pre_final; - if (is_latest == true) + if (is_latest && is_snapshot) { - pre_final.append("Latest"); + return QObject::tr("Latest snapshot"); } - switch (type) + else if(is_latest) { - case OneSix: - pre_final.append("OneSix"); - break; - case Legacy: - pre_final.append("Legacy"); - break; - case Nostalgia: - pre_final.append("Nostalgia"); - break; - - default: - pre_final.append(QString("Type(%1)").arg(type)); - break; + return QObject::tr("Latest release"); + } + else if(is_snapshot) + { + return QObject::tr("Old snapshot"); } - if (is_snapshot == true) + else { - pre_final.append("Snapshot"); + return QObject::tr("Regular release"); } - return pre_final.join(' '); } }; diff --git a/logic/NostalgiaInstance.cpp b/logic/NostalgiaInstance.cpp deleted file mode 100644 index 52820725..00000000 --- a/logic/NostalgiaInstance.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2013 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "NostalgiaInstance.h" - -NostalgiaInstance::NostalgiaInstance(const QString &rootDir, SettingsObject *settings, - QObject *parent) - : OneSixInstance(rootDir, settings, parent) -{ -} - -QString NostalgiaInstance::getStatusbarDescription() -{ - if (flags().contains(VersionBrokenFlag)) - { - return "Nostalgia : " + intendedVersionId() + " (broken)"; - } - return "Nostalgia : " + intendedVersionId(); -} - -bool NostalgiaInstance::menuActionEnabled(QString action_name) const -{ - return false; -} diff --git a/logic/NostalgiaInstance.h b/logic/NostalgiaInstance.h deleted file mode 100644 index f95531d2..00000000 --- a/logic/NostalgiaInstance.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2013 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "OneSixInstance.h" - -class NostalgiaInstance : public OneSixInstance -{ - Q_OBJECT -public: - explicit NostalgiaInstance(const QString &rootDir, SettingsObject *settings, - QObject *parent = 0); - virtual ~NostalgiaInstance() {}; - virtual QString getStatusbarDescription(); - virtual bool menuActionEnabled(QString action_name) const; -}; diff --git a/logic/OneSixFTBInstance.cpp b/logic/OneSixFTBInstance.cpp index 172830bb..34118111 100644 --- a/logic/OneSixFTBInstance.cpp +++ b/logic/OneSixFTBInstance.cpp @@ -3,8 +3,8 @@ #include "VersionFinal.h" #include "OneSixLibrary.h" #include "tasks/SequentialTask.h" -#include "ForgeInstaller.h" -#include "lists/ForgeVersionList.h" +#include "forge/ForgeInstaller.h" +#include "forge/ForgeVersionList.h" #include "OneSixInstance_p.h" #include "OneSixVersionBuilder.h" #include "MultiMC.h" diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index 6f3018cb..dc452188 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -26,7 +26,7 @@ #include "MultiMC.h" #include "icons/IconList.h" #include "MinecraftProcess.h" -#include "gui/dialogs/OneSixModEditDialog.h" +#include "gui/dialogs/InstanceEditDialog.h" #include <MMCError.h> OneSixInstance::OneSixInstance(const QString &rootDir, SettingsObject *settings, QObject *parent) @@ -36,7 +36,6 @@ OneSixInstance::OneSixInstance(const QString &rootDir, SettingsObject *settings, d->m_settings->registerSetting("IntendedVersion", ""); d->m_settings->registerSetting("ShouldUpdate", false); d->version.reset(new VersionFinal(this, this)); - d->vanillaVersion.reset(new VersionFinal(this, this)); } void OneSixInstance::init() @@ -260,6 +259,17 @@ std::shared_ptr<ModList> OneSixInstance::loaderModList() return d->loader_mod_list; } +std::shared_ptr<ModList> OneSixInstance::coreModList() +{ + I_D(OneSixInstance); + if (!d->core_mod_list) + { + d->core_mod_list.reset(new ModList(coreModsDir())); + } + d->core_mod_list->update(); + return d->core_mod_list; +} + std::shared_ptr<ModList> OneSixInstance::resourcePackList() { I_D(OneSixInstance); @@ -273,7 +283,7 @@ std::shared_ptr<ModList> OneSixInstance::resourcePackList() QDialog *OneSixInstance::createModEditDialog(QWidget *parent) { - return new OneSixModEditDialog(this, parent); + return new InstanceEditDialog(this, parent); } bool OneSixInstance::setIntendedVersionId(QString version) @@ -307,10 +317,13 @@ bool OneSixInstance::shouldUpdate() const bool OneSixInstance::versionIsCustom() { - QDir patches(PathCombine(instanceRoot(), "patches/")); - return (patches.exists() && patches.count() >= 0) - || QFile::exists(PathCombine(instanceRoot(), "custom.json")) - || QFile::exists(PathCombine(instanceRoot(), "user.json")); + I_D(const OneSixInstance); + auto ver = d->version; + if(ver) + { + return !ver->isVanilla(); + } + return false; } bool OneSixInstance::versionIsFTBPack() @@ -335,15 +348,13 @@ void OneSixInstance::reloadVersion() try { - d->version->reload(false, externalPatches()); - d->vanillaVersion->reload(true, externalPatches()); + d->version->reload(externalPatches()); d->m_flags.remove(VersionBrokenFlag); emit versionReloaded(); } catch(MMCError & error) { d->version->clear(); - d->vanillaVersion->clear(); d->m_flags.insert(VersionBrokenFlag); //TODO: rethrow to show some error message(s)? emit versionReloaded(); @@ -355,7 +366,6 @@ void OneSixInstance::clearVersion() { I_D(OneSixInstance); d->version->clear(); - d->vanillaVersion->clear(); emit versionReloaded(); } @@ -365,12 +375,6 @@ std::shared_ptr<VersionFinal> OneSixInstance::getFullVersion() const return d->version; } -std::shared_ptr<VersionFinal> OneSixInstance::getVanillaVersion() const -{ - I_D(const OneSixInstance); - return d->vanillaVersion; -} - QString OneSixInstance::defaultBaseJar() const { return "versions/" + intendedVersionId() + "/" + intendedVersionId() + ".jar"; @@ -396,16 +400,24 @@ bool OneSixInstance::menuActionEnabled(QString action_name) const QString OneSixInstance::getStatusbarDescription() { - QString descr = "OneSix : " + intendedVersionId(); + QStringList traits; if (versionIsCustom()) { - descr += " (custom)"; + traits.append(tr("custom")); } if (flags().contains(VersionBrokenFlag)) { - descr += " (broken)"; + traits.append(tr("broken")); + } + + if(traits.size()) + { + return tr("Minecraft %1 (%2)").arg(intendedVersionId()).arg(traits.join(", ")); + } + else + { + return tr("Minecraft %1").arg(intendedVersionId()); } - return descr; } QDir OneSixInstance::librariesPath() const @@ -449,6 +461,11 @@ QString OneSixInstance::loaderModsDir() const return PathCombine(minecraftRoot(), "mods"); } +QString OneSixInstance::coreModsDir() const +{ + return PathCombine(minecraftRoot(), "coremods"); +} + QString OneSixInstance::resourcePacksDir() const { return PathCombine(minecraftRoot(), "resourcepacks"); @@ -458,3 +475,8 @@ QString OneSixInstance::instanceConfigFolder() const { return PathCombine(minecraftRoot(), "config"); } + +QString OneSixInstance::jarModsDir() const +{ + return PathCombine(instanceRoot(), "jarmods"); +} diff --git a/logic/OneSixInstance.h b/logic/OneSixInstance.h index 13a392c2..b26ff752 100644 --- a/logic/OneSixInstance.h +++ b/logic/OneSixInstance.h @@ -32,11 +32,14 @@ public: ////// Mod Lists ////// std::shared_ptr<ModList> loaderModList(); + std::shared_ptr<ModList> coreModList(); std::shared_ptr<ModList> resourcePackList(); - ////// Directories ////// + ////// Directories and files ////// + QString jarModsDir() const; QString resourcePacksDir() const; QString loaderModsDir() const; + QString coreModsDir() const; virtual QString instanceConfigFolder() const override; virtual std::shared_ptr<Task> doUpdate() override; @@ -60,14 +63,16 @@ public: * throws various exceptions :3 */ void reloadVersion(); + /// clears all version information in preparation for an update void clearVersion(); + /// get the current full version info std::shared_ptr<VersionFinal> getFullVersion() const; - /// gets the current version info, but only for version.json - std::shared_ptr<VersionFinal> getVanillaVersion() const; + /// is the current version original, or custom? virtual bool versionIsCustom() override; + /// does this instance have an FTB pack patch inside? bool versionIsFTBPack(); diff --git a/logic/OneSixInstance_p.h b/logic/OneSixInstance_p.h index c70de07c..e75a8da3 100644 --- a/logic/OneSixInstance_p.h +++ b/logic/OneSixInstance_p.h @@ -24,7 +24,8 @@ class OneSixInstancePrivate : public BaseInstancePrivate public: virtual ~OneSixInstancePrivate() {}; std::shared_ptr<VersionFinal> version; - std::shared_ptr<VersionFinal> vanillaVersion; + std::shared_ptr<ModList> jar_mod_list; std::shared_ptr<ModList> loader_mod_list; + std::shared_ptr<ModList> core_mod_list; std::shared_ptr<ModList> resource_pack_list; }; diff --git a/logic/OneSixLibrary.h b/logic/OneSixLibrary.h index 61d4c8e2..1c7169ce 100644 --- a/logic/OneSixLibrary.h +++ b/logic/OneSixLibrary.h @@ -41,7 +41,7 @@ private: // custom values /// absolute URL. takes precedence over m_download_path, if defined QString m_absolute_url; - /// download hint - how to actually get the library + /// type hint - modifies how the library is treated QString m_hint; // derived values used for real things diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp index d083c2ba..da2fd29c 100644 --- a/logic/OneSixUpdate.cpp +++ b/logic/OneSixUpdate.cpp @@ -28,7 +28,7 @@ #include "VersionFinal.h" #include "OneSixLibrary.h" #include "OneSixInstance.h" -#include "net/ForgeMirrors.h" +#include "logic/forge/ForgeMirrors.h" #include "net/URLConstants.h" #include "assets/AssetsUtils.h" diff --git a/logic/OneSixVersionBuilder.cpp b/logic/OneSixVersionBuilder.cpp index be3a7da4..3fb96c5e 100644 --- a/logic/OneSixVersionBuilder.cpp +++ b/logic/OneSixVersionBuilder.cpp @@ -38,13 +38,12 @@ OneSixVersionBuilder::OneSixVersionBuilder() { } -void OneSixVersionBuilder::build(VersionFinal *version, OneSixInstance *instance, - const bool onlyVanilla, const QStringList &external) +void OneSixVersionBuilder::build(VersionFinal *version, OneSixInstance *instance, const QStringList &external) { OneSixVersionBuilder builder; builder.m_version = version; builder.m_instance = instance; - builder.buildInternal(onlyVanilla, external); + builder.buildInternal(external); } void OneSixVersionBuilder::readJsonAndApplyToVersion(VersionFinal *version, @@ -56,7 +55,7 @@ void OneSixVersionBuilder::readJsonAndApplyToVersion(VersionFinal *version, builder.readJsonAndApply(obj); } -void OneSixVersionBuilder::buildInternal(const bool onlyVanilla, const QStringList &external) +void OneSixVersionBuilder::buildInternal(const QStringList &external) { m_version->versionFiles.clear(); @@ -111,9 +110,6 @@ void OneSixVersionBuilder::buildInternal(const bool onlyVanilla, const QStringLi // QObject::tr("Error while applying %1. Please check MultiMC-0.log for more // info.").arg(root.absoluteFilePath("version.json"))); - if (onlyVanilla) - break; - // patches/ // load all, put into map for ordering, apply in the right order diff --git a/logic/OneSixVersionBuilder.h b/logic/OneSixVersionBuilder.h index 7a799e5b..6646584e 100644 --- a/logic/OneSixVersionBuilder.h +++ b/logic/OneSixVersionBuilder.h @@ -28,8 +28,7 @@ class OneSixVersionBuilder { OneSixVersionBuilder(); public: - static void build(VersionFinal *version, OneSixInstance *instance, const bool onlyVanilla, - const QStringList &external); + static void build(VersionFinal *version, OneSixInstance *instance, const QStringList &external); static void readJsonAndApplyToVersion(VersionFinal *version, const QJsonObject &obj); static QMap<QString, int> readOverrideOrders(OneSixInstance *instance); @@ -39,7 +38,7 @@ private: VersionFinal *m_version; OneSixInstance *m_instance; - void buildInternal(const bool onlyVanilla, const QStringList &external); + void buildInternal(const QStringList& external); void readJsonAndApply(const QJsonObject &obj); VersionFilePtr parseJsonFile(const QFileInfo &fileInfo, const bool requireOrder, diff --git a/logic/VersionFile.cpp b/logic/VersionFile.cpp index cd2a4f9c..4a850f97 100644 --- a/logic/VersionFile.cpp +++ b/logic/VersionFile.cpp @@ -13,6 +13,43 @@ using namespace MMCJson; #define CURRENT_MINIMUM_LAUNCHER_VERSION 14 +JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename) +{ + JarmodPtr out(new Jarmod()); + if (!libObj.contains("name")) + { + throw JSONValidationError(filename + + "contains a jarmod that doesn't have a 'name' field"); + } + out->name = libObj.value("name").toString(); + + auto readString = [libObj, filename](const QString & key, QString & variable) + { + if (libObj.contains(key)) + { + QJsonValue val = libObj.value(key); + if (!val.isString()) + { + QLOG_WARN() << key << "is not a string in" << filename << "(skipping)"; + } + else + { + variable = val.toString(); + } + } + }; + + readString("url", out->baseurl); + readString("MMC-absoluteUrl", out->absoluteUrl); + if(!out->baseurl.isEmpty() && out->absoluteUrl.isEmpty()) + { + out->absoluteUrl = out->baseurl + out->name; + } + return out; + +} + + RawLibraryPtr RawLibrary::fromJson(const QJsonObject &libObj, const QString &filename) { RawLibraryPtr out(new RawLibrary()); @@ -165,6 +202,14 @@ VersionFilePtr VersionFile::fromJson(const QJsonDocument &doc, const QString &fi } } + if (root.contains("+traits")) + { + for (auto tweakerVal : ensureArray(root.value("+traits"))) + { + out->traits.insert(ensureString(tweakerVal)); + } + } + if (root.contains("libraries")) { // FIXME: This should be done when applying. @@ -188,6 +233,18 @@ VersionFilePtr VersionFile::fromJson(const QJsonDocument &doc, const QString &fi } } + if (root.contains("+jarMods")) + { + for (auto libVal : ensureArray(root.value("+jarMods"))) + { + QJsonObject libObj = ensureObject(libVal); + // parse the jarmod + auto lib = Jarmod::fromJson(libObj, filename); + // and add to jar mods + out->jarMods.append(lib); + } + } + if (root.contains("+libraries")) { for (auto libVal : ensureArray(root.value("+libraries"))) @@ -258,6 +315,7 @@ VersionFilePtr VersionFile::fromJson(const QJsonDocument &doc, const QString &fi out->addLibs.append(lib); } } + if (root.contains("-libraries")) { for (auto libVal : ensureArray(root.value("-libraries"))) @@ -309,6 +367,16 @@ int VersionFile::findLibrary(QList<OneSixLibraryPtr> haystack, const QString &ne return retval; } +bool VersionFile::isVanilla() +{ + return fileId == "org.multimc.version.json"; +} + +bool VersionFile::hasJarMods() +{ + return !jarMods.isEmpty(); +} + void VersionFile::applyTo(VersionFinal *version) { if (minimumLauncherVersion != -1) @@ -338,6 +406,10 @@ void VersionFile::applyTo(VersionFinal *version) } if (!processArguments.isNull()) { + if(isVanilla()) + { + version->vanillaProcessArguments = processArguments; + } version->processArguments = processArguments; } if (!type.isNull()) @@ -362,6 +434,10 @@ void VersionFile::applyTo(VersionFinal *version) } if (!overwriteMinecraftArguments.isNull()) { + if(isVanilla()) + { + version->vanillaMinecraftArguments = overwriteMinecraftArguments; + } version->minecraftArguments = overwriteMinecraftArguments; } if (!addMinecraftArguments.isNull()) @@ -384,13 +460,17 @@ void VersionFile::applyTo(VersionFinal *version) { version->tweakers.removeAll(tweaker); } + version->jarMods.append(jarMods); if (shouldOverwriteLibs) { - version->libraries.clear(); + QList<OneSixLibraryPtr> libs; for (auto lib : overwriteLibs) { - version->libraries.append(createLibrary(lib)); + libs.append(createLibrary(lib)); } + if(isVanilla()) + version->vanillaLibraries = libs; + version->libraries = libs; } for (auto lib : addLibs) { diff --git a/logic/VersionFile.h b/logic/VersionFile.h index 169a2066..2332e6d4 100644 --- a/logic/VersionFile.h +++ b/logic/VersionFile.h @@ -81,6 +81,18 @@ struct RawLibrary static RawLibraryPtr fromJson(const QJsonObject &libObj, const QString &filename); }; +struct Jarmod; +typedef std::shared_ptr<Jarmod> JarmodPtr; +struct Jarmod +{ + QString name; + QString baseurl; + QString hint; + QString absoluteUrl; + + static JarmodPtr fromJson(const QJsonObject &libObj, const QString &filename); +}; + struct VersionFile; typedef std::shared_ptr<VersionFile> VersionFilePtr; struct VersionFile @@ -92,7 +104,8 @@ public: /* methods */ static OneSixLibraryPtr createLibrary(RawLibraryPtr lib); int findLibrary(QList<OneSixLibraryPtr> haystack, const QString &needle); void applyTo(VersionFinal *version); - + bool isVanilla(); + bool hasJarMods(); public: /* data */ int order = 0; QString name; @@ -124,4 +137,8 @@ public: /* data */ QList<RawLibraryPtr> overwriteLibs; QList<RawLibraryPtr> addLibs; QList<QString> removeLibs; + + QSet<QString> traits; + + QList<JarmodPtr> jarMods; }; diff --git a/logic/VersionFinal.cpp b/logic/VersionFinal.cpp index dedf2ce5..18bd360b 100644 --- a/logic/VersionFinal.cpp +++ b/logic/VersionFinal.cpp @@ -21,16 +21,7 @@ #include "OneSixVersionBuilder.h" #include "OneSixInstance.h" - -template <typename A, typename B> QMap<A, B> invert(const QMap<B, A> &in) -{ - QMap<A, B> out; - for (auto it = in.begin(); it != in.end(); ++it) - { - out.insert(it.value(), it.key()); - } - return out; -} +#include <pathutils.h> VersionFinal::VersionFinal(OneSixInstance *instance, QObject *parent) : QAbstractListModel(parent), m_instance(instance) @@ -38,11 +29,10 @@ VersionFinal::VersionFinal(OneSixInstance *instance, QObject *parent) clear(); } -void VersionFinal::reload(const bool onlyVanilla, const QStringList &external) +void VersionFinal::reload(const QStringList &external) { - //FIXME: source of epic failure. beginResetModel(); - OneSixVersionBuilder::build(this, m_instance, onlyVanilla, external); + OneSixVersionBuilder::build(this, m_instance, external); reapply(true); endResetModel(); } @@ -60,6 +50,8 @@ void VersionFinal::clear() mainClass.clear(); libraries.clear(); tweakers.clear(); + jarMods.clear(); + traits.clear(); } bool VersionFinal::canRemove(const int index) const @@ -119,6 +111,11 @@ VersionFilePtr VersionFinal::versionFile(const QString &id) return 0; } +bool VersionFinal::hasJarMods() +{ + return !jarMods.isEmpty(); +} + bool VersionFinal::hasFtbPack() { return versionFile("org.multimc.ftb.pack.json") != nullptr; @@ -129,6 +126,36 @@ bool VersionFinal::removeFtbPack() return remove("org.multimc.ftb.pack.json"); } +bool VersionFinal::isVanilla() +{ + QDir patches(PathCombine(m_instance->instanceRoot(), "patches/")); + return versionFiles.size() > 1 || QFile::exists(PathCombine(m_instance->instanceRoot(), "custom.json")); +} + +bool VersionFinal::revertToVanilla() +{ + beginResetModel(); + auto it = versionFiles.begin(); + while (it != versionFiles.end()) + { + if ((*it)->fileId != "org.multimc.version.json") + { + QFile::remove((*it)->filename); + it = versionFiles.erase(it); + } + else + it++; + } + reapply(true); + endResetModel(); + return true; +} + +bool VersionFinal::usesLegacyCustomJson() +{ + return QFile::exists(PathCombine(m_instance->instanceRoot(), "custom.json")); +} + QList<std::shared_ptr<OneSixLibrary> > VersionFinal::getActiveNormalLibs() { QList<std::shared_ptr<OneSixLibrary> > output; @@ -229,15 +256,6 @@ int VersionFinal::columnCount(const QModelIndex &parent) const return 2; } -bool VersionFinal::isCustom() -{ - return QDir(m_instance->instanceRoot()).exists("custom.json"); -} -bool VersionFinal::revertToBase() -{ - return QDir(m_instance->instanceRoot()).remove("custom.json"); -} - QMap<QString, int> VersionFinal::getExistingOrder() const { @@ -356,8 +374,10 @@ void VersionFinal::finalize() { assets = "legacy"; } - if (minecraftArguments.isEmpty()) + auto finalizeArguments = [&]( QString & minecraftArguments, const QString & processArguments ) -> void { + if (!minecraftArguments.isEmpty()) + return; QString toCompare = processArguments.toLower(); if (toCompare == "legacy") { @@ -370,8 +390,11 @@ void VersionFinal::finalize() else if (toCompare == "username_session_version") { minecraftArguments = "--username ${auth_player_name} " - "--session ${auth_session} " - "--version ${profile_name}"; + "--session ${auth_session} " + "--version ${profile_name}"; } - } + }; + finalizeArguments(vanillaMinecraftArguments, vanillaProcessArguments); + finalizeArguments(minecraftArguments, processArguments); } + diff --git a/logic/VersionFinal.h b/logic/VersionFinal.h index 41fd23bd..71e43399 100644 --- a/logic/VersionFinal.h +++ b/logic/VersionFinal.h @@ -38,22 +38,29 @@ public: virtual int columnCount(const QModelIndex &parent) const; virtual Qt::ItemFlags flags(const QModelIndex &index) const; - void reload(const bool onlyVanilla = false, const QStringList &external = QStringList()); + void reload(const QStringList &external = QStringList()); void clear(); bool canRemove(const int index) const; QString versionFileId(const int index) const; - // does this instance have an all overriding custom.json - bool isCustom(); - // remove custom.json - bool revertToBase(); - // does this instance have an FTB pack patch file? + // is this version unmodded vanilla minecraft? + bool isVanilla(); + // remove any customizations on top of vanilla + bool revertToVanilla(); + + // does this version have an FTB pack patch file? bool hasFtbPack(); // remove FTB pack bool removeFtbPack(); + // does this version have any jar mods? + bool hasJarMods(); + + // does this version still use a legacy custom.json file? + bool usesLegacyCustomJson(); + enum MoveDirection { MoveUp, MoveDown }; void move(const int index, const MoveDirection direction); @@ -91,6 +98,8 @@ public: * ex: "username_session_version" */ QString processArguments; + /// Same as above, but only for vanilla + QString vanillaProcessArguments; /** * arguments that should be used for launching minecraft * @@ -98,6 +107,8 @@ public: * --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets}" */ QString minecraftArguments; + /// Same as above, but only for vanilla + QString vanillaMinecraftArguments; /** * the minimum launcher version required by this version ... current is 4 (at point of * writing) @@ -114,6 +125,15 @@ public: /// the list of libs - both active and inactive, native and java QList<std::shared_ptr<OneSixLibrary>> libraries; + + /// same, but only vanilla. + QList<std::shared_ptr<OneSixLibrary>> vanillaLibraries; + + /// traits, collected from all the version files (version files can only add) + QSet<QString> traits; + + /// A list of jar mods. version files can add those. + QList<JarmodPtr> jarMods; /* FIXME: add support for those rules here? Looks like a pile of quick hacks to me though. diff --git a/logic/forge/ForgeData.cpp b/logic/forge/ForgeData.cpp new file mode 100644 index 00000000..700b847b --- /dev/null +++ b/logic/forge/ForgeData.cpp @@ -0,0 +1,62 @@ +#include "ForgeData.h" + +extern ForgeData g_forgeData = ForgeData(); + +ForgeData::ForgeData() +{ + // 1.3.* + auto libs13 = + QList<FMLlib>{{"argo-2.25.jar", "bb672829fde76cb163004752b86b0484bd0a7f4b", false}, + {"guava-12.0.1.jar", "b8e78b9af7bf45900e14c6f958486b6ca682195f", false}, + {"asm-all-4.0.jar", "98308890597acb64047f7e896638e0d98753ae82", false}}; + + fmlLibsMapping["1.3.2"] = libs13; + + // 1.4.* + auto libs14 = QList<FMLlib>{ + {"argo-2.25.jar", "bb672829fde76cb163004752b86b0484bd0a7f4b", false}, + {"guava-12.0.1.jar", "b8e78b9af7bf45900e14c6f958486b6ca682195f", false}, + {"asm-all-4.0.jar", "98308890597acb64047f7e896638e0d98753ae82", false}, + {"bcprov-jdk15on-147.jar", "b6f5d9926b0afbde9f4dbe3db88c5247be7794bb", false}}; + + fmlLibsMapping["1.4"] = libs14; + fmlLibsMapping["1.4.1"] = libs14; + fmlLibsMapping["1.4.2"] = libs14; + fmlLibsMapping["1.4.3"] = libs14; + fmlLibsMapping["1.4.4"] = libs14; + fmlLibsMapping["1.4.5"] = libs14; + fmlLibsMapping["1.4.6"] = libs14; + fmlLibsMapping["1.4.7"] = libs14; + + // 1.5 + fmlLibsMapping["1.5"] = QList<FMLlib>{ + {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, + {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, + {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, + {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, + {"deobfuscation_data_1.5.zip", "5f7c142d53776f16304c0bbe10542014abad6af8", false}, + {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; + + // 1.5.1 + fmlLibsMapping["1.5.1"] = QList<FMLlib>{ + {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, + {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, + {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, + {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, + {"deobfuscation_data_1.5.1.zip", "22e221a0d89516c1f721d6cab056a7e37471d0a6", false}, + {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; + + // 1.5.2 + fmlLibsMapping["1.5.2"] = QList<FMLlib>{ + {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, + {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, + {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, + {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, + {"deobfuscation_data_1.5.2.zip", "446e55cd986582c70fcf12cb27bc00114c5adfd9", false}, + {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; + + // don't use installers for those. + forgeInstallerBlacklist = QSet<QString>({ + "1.5.2" + }); +} diff --git a/logic/forge/ForgeData.h b/logic/forge/ForgeData.h new file mode 100644 index 00000000..27749778 --- /dev/null +++ b/logic/forge/ForgeData.h @@ -0,0 +1,21 @@ +#pragma once +#include <QMap> +#include <QString> +#include <QSet> + +struct FMLlib +{ + QString filename; + QString checksum; + bool ours; +}; + +struct ForgeData +{ + ForgeData(); + // mapping between minecraft versions and FML libraries required + QMap<QString, QList<FMLlib>> fmlLibsMapping; + // set of minecraft versions for which using forge installers is blacklisted + QSet<QString> forgeInstallerBlacklist; +}; +extern ForgeData g_forgeData; diff --git a/logic/ForgeInstaller.cpp b/logic/forge/ForgeInstaller.cpp index 94b3f319..1204b855 100644 --- a/logic/ForgeInstaller.cpp +++ b/logic/forge/ForgeInstaller.cpp @@ -14,9 +14,15 @@ */ #include "ForgeInstaller.h" -#include "VersionFinal.h" -#include "OneSixLibrary.h" -#include "net/HttpMetaCache.h" +#include "logic/VersionFinal.h" +#include "logic/OneSixLibrary.h" +#include "logic/net/HttpMetaCache.h" +#include "logic/tasks/Task.h" +#include "logic/OneSixInstance.h" +#include "logic/forge/ForgeVersionList.h" +#include "ForgeData.h" +#include "gui/dialogs/ProgressDialog.h" + #include <quazip.h> #include <quazipfile.h> #include <pathutils.h> @@ -24,18 +30,12 @@ #include <QRegularExpression> #include <QRegularExpressionMatch> #include "MultiMC.h" -#include "tasks/Task.h" -#include "OneSixInstance.h" -#include "lists/ForgeVersionList.h" -#include "gui/dialogs/ProgressDialog.h" - #include <QJsonDocument> #include <QJsonArray> #include <QSaveFile> #include <QCryptographicHash> -ForgeInstaller::ForgeInstaller() - : BaseInstaller() +ForgeInstaller::ForgeInstaller() : BaseInstaller() { } void ForgeInstaller::prepare(const QString &filename, const QString &universalUrl) @@ -115,8 +115,8 @@ void ForgeInstaller::prepare(const QString &filename, const QString &universalUr } file.close(); - m_forge_version = newVersion; - realVersionId = m_forge_version->id = installObj.value("minecraft").toString(); + m_forge_json = newVersion; + realVersionId = m_forge_json->id = installObj.value("minecraft").toString(); } bool ForgeInstaller::add(OneSixInstance *to) { @@ -128,7 +128,7 @@ bool ForgeInstaller::add(OneSixInstance *to) QJsonObject obj; obj.insert("order", 5); - if (!m_forge_version) + if (!m_forge_json) return false; int sliding_insert_window = 0; { @@ -136,7 +136,7 @@ bool ForgeInstaller::add(OneSixInstance *to) // for each library in the version we are adding (except for the blacklisted) QSet<QString> blacklist{"lwjgl", "lwjgl_util", "lwjgl-platform"}; - for (auto lib : m_forge_version->libraries) + for (auto lib : m_forge_json->libraries) { QString libName = lib->name(); // WARNING: This could actually break. @@ -157,7 +157,7 @@ bool ForgeInstaller::add(OneSixInstance *to) bool found = false; bool equals = false; // find an entry that matches this one - for (auto tolib : to->getVanillaVersion()->libraries) + for (auto tolib : to->getFullVersion()->vanillaLibraries) { if (tolib->name() != libName) continue; @@ -187,8 +187,8 @@ bool ForgeInstaller::add(OneSixInstance *to) librariesPlus.prepend(libObj); } obj.insert("+libraries", librariesPlus); - obj.insert("mainClass", m_forge_version->mainClass); - QString args = m_forge_version->minecraftArguments; + obj.insert("mainClass", m_forge_json->mainClass); + QString args = m_forge_json->minecraftArguments; QStringList tweakers; { QRegularExpression expression("--tweakClass ([a-zA-Z0-9\\.]*)"); @@ -200,7 +200,7 @@ bool ForgeInstaller::add(OneSixInstance *to) match = expression.match(args); } } - if (!args.isEmpty() && args != to->getVanillaVersion()->minecraftArguments) + if (!args.isEmpty() && args != to->getFullVersion()->vanillaMinecraftArguments) { obj.insert("minecraftArguments", args); } @@ -208,10 +208,10 @@ bool ForgeInstaller::add(OneSixInstance *to) { obj.insert("+tweakers", QJsonArray::fromStringList(tweakers)); } - if (!m_forge_version->processArguments.isEmpty() && - m_forge_version->processArguments != to->getVanillaVersion()->processArguments) + if (!m_forge_json->processArguments.isEmpty() && + m_forge_json->processArguments != to->getFullVersion()->vanillaProcessArguments) { - obj.insert("processArguments", m_forge_version->processArguments); + obj.insert("processArguments", m_forge_json->processArguments); } } @@ -233,11 +233,54 @@ bool ForgeInstaller::add(OneSixInstance *to) return true; } +bool ForgeInstaller::addLegacy(OneSixInstance *to) +{ + if (!BaseInstaller::add(to)) + { + return false; + } + + QJsonObject obj; + obj.insert("order", 5); + { + QJsonArray jarmodsPlus; + { + QJsonObject libObj; + libObj.insert("name", m_forge_version->universal_filename); + jarmodsPlus.append(libObj); + } + obj.insert("+jarMods", jarmodsPlus); + } + + obj.insert("name", QString("Forge")); + obj.insert("fileId", id()); + obj.insert("version", m_forge_version->jobbuildver); + obj.insert("mcVersion", to->intendedVersionId()); + if (g_forgeData.fmlLibsMapping.contains(m_forge_version->mcver)) + { + QJsonArray traitsPlus; + traitsPlus.append(QString("legacyFML")); + obj.insert("+traits", traitsPlus); + } + + QFile file(filename(to->instanceRoot())); + if (!file.open(QFile::WriteOnly)) + { + QLOG_ERROR() << "Error opening" << file.fileName() + << "for reading:" << file.errorString(); + return false; + } + file.write(QJsonDocument(obj).toJson()); + file.close(); + return true; +} + class ForgeInstallTask : public Task { Q_OBJECT public: - ForgeInstallTask(ForgeInstaller *installer, OneSixInstance *instance, BaseVersionPtr version, QObject *parent = 0) + ForgeInstallTask(ForgeInstaller *installer, OneSixInstance *instance, + BaseVersionPtr version, QObject *parent = 0) : Task(parent), m_installer(installer), m_instance(instance), m_version(version) { } @@ -245,57 +288,60 @@ public: protected: void executeTask() override { + setStatus(tr("Installing forge...")); + ForgeVersionPtr forgeVersion = std::dynamic_pointer_cast<ForgeVersion>(m_version); + if (!forgeVersion) { - setStatus(tr("Installing forge...")); - ForgeVersionPtr forgeVersion = - std::dynamic_pointer_cast<ForgeVersion>(m_version); - if (!forgeVersion) + emitFailed(tr("Unknown error occured")); + return; + } + prepare(forgeVersion); + } + void prepare(ForgeVersionPtr forgeVersion) + { + auto entry = + MMC->metacache()->resolveEntry("minecraftforge", forgeVersion->filename()); + auto installFunction = [this, entry, forgeVersion]() + { + if (!install(entry, forgeVersion)) { - emitFailed(tr("Unknown error occured")); - return; - } - auto entry = MMC->metacache()->resolveEntry("minecraftforge", forgeVersion->filename); - if (entry->stale) - { - NetJob *fjob = new NetJob("Forge download"); - fjob->addNetAction(CacheDownload::make(forgeVersion->installer_url, entry)); - connect(fjob, &NetJob::progress, [this](qint64 current, qint64 total){setProgress(100 * current / qMax((qint64)1, total));}); - connect(fjob, &NetJob::status, [this](const QString &msg){setStatus(msg);}); - connect(fjob, &NetJob::failed, [this](){emitFailed(tr("Failure to download forge"));}); - connect(fjob, &NetJob::succeeded, [this, entry, forgeVersion]() - { - if (!install(entry, forgeVersion)) - { - QLOG_ERROR() << "Failure installing forge"; - emitFailed(tr("Failure to install forge")); - } - else - { - reload(); - } - }); - fjob->start(); + QLOG_ERROR() << "Failure installing forge"; + emitFailed(tr("Failure to install forge")); } else { - if (!install(entry, forgeVersion)) - { - QLOG_ERROR() << "Failure installing forge"; - emitFailed(tr("Failure to install forge")); - } - else - { - reload(); - } + reload(); } + }; + + if (entry->stale) + { + NetJob *fjob = new NetJob("Forge download"); + fjob->addNetAction(CacheDownload::make(forgeVersion->url(), entry)); + connect(fjob, &NetJob::progress, [this](qint64 current, qint64 total) + { setProgress(100 * current / qMax((qint64)1, total)); }); + connect(fjob, &NetJob::status, [this](const QString & msg) + { setStatus(msg); }); + connect(fjob, &NetJob::failed, [this]() + { emitFailed(tr("Failure to download forge")); }); + connect(fjob, &NetJob::succeeded, installFunction); + fjob->start(); + } + else + { + installFunction(); } } - bool install(const std::shared_ptr<MetaEntry> &entry, const ForgeVersionPtr &forgeVersion) { - QString forgePath = entry->getFullPath(); - m_installer->prepare(forgePath, forgeVersion->universal_url); - return m_installer->add(m_instance); + if (forgeVersion->usesInstaller()) + { + QString forgePath = entry->getFullPath(); + m_installer->prepare(forgePath, forgeVersion->universal_url); + return m_installer->add(m_instance); + } + else + return m_installer->addLegacy(m_instance); } void reload() { @@ -320,8 +366,14 @@ private: BaseVersionPtr m_version; }; -ProgressProvider *ForgeInstaller::createInstallTask(OneSixInstance *instance, BaseVersionPtr version, QObject *parent) +ProgressProvider *ForgeInstaller::createInstallTask(OneSixInstance *instance, + BaseVersionPtr version, QObject *parent) { + if (!version) + { + return nullptr; + } + m_forge_version = std::dynamic_pointer_cast<ForgeVersion>(version); return new ForgeInstallTask(this, instance, version, parent); } diff --git a/logic/ForgeInstaller.h b/logic/forge/ForgeInstaller.h index 05cc994b..dafa6305 100644 --- a/logic/ForgeInstaller.h +++ b/logic/forge/ForgeInstaller.h @@ -15,28 +15,34 @@ #pragma once -#include "BaseInstaller.h" +#include "logic/BaseInstaller.h" #include <QString> #include <memory> class VersionFinal; +class ForgeInstallTask; +class ForgeVersion; class ForgeInstaller : public BaseInstaller { + friend class ForgeInstallTask; public: ForgeInstaller(); + virtual ~ForgeInstaller(){}; + virtual ProgressProvider *createInstallTask(OneSixInstance *instance, BaseVersionPtr version, QObject *parent) override; +protected: + virtual QString id() const override { return "net.minecraftforge"; } void prepare(const QString &filename, const QString &universalUrl); bool add(OneSixInstance *to) override; - - QString id() const override { return "net.minecraftforge"; } - - ProgressProvider *createInstallTask(OneSixInstance *instance, BaseVersionPtr version, QObject *parent) override; + bool addLegacy(OneSixInstance *to); private: - // the version, read from the installer - std::shared_ptr<VersionFinal> m_forge_version; + // the parsed version json, read from the installer + std::shared_ptr<VersionFinal> m_forge_json; + // the actual forge version + std::shared_ptr<ForgeVersion> m_forge_version; QString internalPath; QString finalPath; QString realVersionId; diff --git a/logic/net/ForgeMirror.h b/logic/forge/ForgeMirror.h index 2518dffe..2518dffe 100644 --- a/logic/net/ForgeMirror.h +++ b/logic/forge/ForgeMirror.h diff --git a/logic/net/ForgeMirrors.cpp b/logic/forge/ForgeMirrors.cpp index b224306f..b224306f 100644 --- a/logic/net/ForgeMirrors.cpp +++ b/logic/forge/ForgeMirrors.cpp diff --git a/logic/net/ForgeMirrors.h b/logic/forge/ForgeMirrors.h index 6784fba1..d25762db 100644 --- a/logic/net/ForgeMirrors.h +++ b/logic/forge/ForgeMirrors.h @@ -15,10 +15,10 @@ #pragma once -#include "NetAction.h" -#include "HttpMetaCache.h" -#include "ForgeXzDownload.h" -#include "NetJob.h" +#include "logic/net/NetAction.h" +#include "logic/net/HttpMetaCache.h" +#include "logic/net/NetJob.h" +#include "logic/forge/ForgeXzDownload.h" #include <QFile> #include <QTemporaryFile> typedef std::shared_ptr<class ForgeMirrors> ForgeMirrorsPtr; diff --git a/logic/forge/ForgeVersion.cpp b/logic/forge/ForgeVersion.cpp new file mode 100644 index 00000000..fd4efc4b --- /dev/null +++ b/logic/forge/ForgeVersion.cpp @@ -0,0 +1,55 @@ +#include "ForgeVersion.h" +#include "ForgeData.h" +#include <QObject> + +QString ForgeVersion::name() +{ + return "Forge " + jobbuildver; +} + +QString ForgeVersion::descriptor() +{ + return universal_filename; +} + +QString ForgeVersion::typeString() const +{ + if (is_recommended) + return QObject::tr("Recommended"); + return QString(); +} + +bool ForgeVersion::operator<(BaseVersion &a) +{ + ForgeVersion *pa = dynamic_cast<ForgeVersion *>(&a); + if (!pa) + return true; + return m_buildnr < pa->m_buildnr; +} + +bool ForgeVersion::operator>(BaseVersion &a) +{ + ForgeVersion *pa = dynamic_cast<ForgeVersion *>(&a); + if (!pa) + return false; + return m_buildnr > pa->m_buildnr; +} + +bool ForgeVersion::usesInstaller() +{ + if(installer_url.isEmpty()) + return false; + if(g_forgeData.forgeInstallerBlacklist.contains(mcver)) + return false; + return true; +} + +QString ForgeVersion::filename() +{ + return usesInstaller() ? installer_filename : universal_filename; +} + +QString ForgeVersion::url() +{ + return usesInstaller() ? installer_url : universal_url; +} diff --git a/logic/forge/ForgeVersion.h b/logic/forge/ForgeVersion.h new file mode 100644 index 00000000..74e45c5a --- /dev/null +++ b/logic/forge/ForgeVersion.h @@ -0,0 +1,31 @@ +#pragma once +#include <QString> +#include <memory> +#include "logic/BaseVersion.h" + +struct ForgeVersion; +typedef std::shared_ptr<ForgeVersion> ForgeVersionPtr; + +struct ForgeVersion : public BaseVersion +{ + virtual QString descriptor() override; + virtual QString name() override; + virtual QString typeString() const override; + virtual bool operator<(BaseVersion &a) override; + virtual bool operator>(BaseVersion &a) override; + + QString filename(); + QString url(); + + bool usesInstaller(); + + int m_buildnr = 0; + QString universal_url; + QString changelog_url; + QString installer_url; + QString jobbuildver; + QString mcver; + QString universal_filename; + QString installer_filename; + bool is_recommended = false; +}; diff --git a/logic/lists/ForgeVersionList.cpp b/logic/forge/ForgeVersionList.cpp index 4902dc64..c873bab7 100644 --- a/logic/lists/ForgeVersionList.cpp +++ b/logic/forge/ForgeVersionList.cpp @@ -13,9 +13,10 @@ * limitations under the License. */ -#include "ForgeVersionList.h" -#include <logic/net/NetJob.h> -#include <logic/net/URLConstants.h> +#include "logic/forge/ForgeVersionList.h" +#include "logic/forge/ForgeVersion.h" +#include "logic/net/NetJob.h" +#include "logic/net/URLConstants.h" #include "MultiMC.h" #include <QtNetwork> @@ -236,7 +237,7 @@ bool ForgeListLoadTask::parseForgeList(QList<BaseVersionPtr> &out) if (!build_nr) continue; QJsonArray files = obj.value("files").toArray(); - QString url, jobbuildver, mcver, buildtype, filename; + QString url, jobbuildver, mcver, buildtype, universal_filename; QString changelog_url, installer_url; QString installer_filename; bool valid = false; @@ -254,7 +255,7 @@ bool ForgeListLoadTask::parseForgeList(QList<BaseVersionPtr> &out) url = file.value("url").toString(); jobbuildver = file.value("jobbuildver").toString(); int lastSlash = url.lastIndexOf('/'); - filename = url.mid(lastSlash + 1); + universal_filename = url.mid(lastSlash + 1); valid = true; } else if (buildtype == "changelog") @@ -282,14 +283,8 @@ bool ForgeListLoadTask::parseForgeList(QList<BaseVersionPtr> &out) fVersion->installer_url = installer_url; fVersion->jobbuildver = jobbuildver; fVersion->mcver = mcver; - if (installer_filename.isEmpty()) - { - fVersion->filename = filename; - } - else - { - fVersion->filename = installer_filename; - } + fVersion->installer_filename = installer_filename; + fVersion->universal_filename = universal_filename; fVersion->m_buildnr = build_nr; out.append(fVersion); } @@ -342,7 +337,7 @@ bool ForgeListLoadTask::parseForgeGradleList(QList<BaseVersionPtr> &out) fVersion->m_buildnr = number.value("build").toDouble(); fVersion->jobbuildver = number.value("version").toString(); fVersion->mcver = number.value("mcversion").toString(); - fVersion->filename = ""; + fVersion->universal_filename = ""; QString filename, installer_filename; QJsonArray files = number.value("files").toArray(); for (auto fIt = files.begin(); fIt != files.end(); ++fIt) @@ -380,7 +375,8 @@ bool ForgeListLoadTask::parseForgeGradleList(QList<BaseVersionPtr> &out) { continue; } - fVersion->filename = fVersion->installer_url.isEmpty() ? filename : installer_filename; + fVersion->universal_filename = filename; + fVersion->installer_filename = installer_filename; out.append(fVersion); } diff --git a/logic/lists/ForgeVersionList.h b/logic/forge/ForgeVersionList.h index b19d3f56..c848e9b8 100644 --- a/logic/lists/ForgeVersionList.h +++ b/logic/forge/ForgeVersionList.h @@ -18,57 +18,12 @@ #include <QObject> #include <QAbstractListModel> #include <QUrl> - #include <QNetworkReply> -#include "BaseVersionList.h" + +#include "logic/lists/BaseVersionList.h" #include "logic/tasks/Task.h" #include "logic/net/NetJob.h" - -class ForgeVersion; -typedef std::shared_ptr<ForgeVersion> ForgeVersionPtr; - -struct ForgeVersion : public BaseVersion -{ - virtual QString descriptor() override - { - return filename; - } - ; - virtual QString name() override - { - return "Forge " + jobbuildver; - } - ; - virtual QString typeString() const override - { - if (installer_url.isEmpty()) - return "Universal"; - else - return "Installer"; - } - - virtual bool operator<(BaseVersion &a) override - { - ForgeVersion *pa = dynamic_cast<ForgeVersion *>(&a); - if(!pa) - return true; - return m_buildnr < pa->m_buildnr; - } - virtual bool operator>(BaseVersion &a) override - { - ForgeVersion *pa = dynamic_cast<ForgeVersion *>(&a); - if(!pa) - return false; - return m_buildnr > pa->m_buildnr; - } - int m_buildnr = 0; - QString universal_url; - QString changelog_url; - QString installer_url; - QString jobbuildver; - QString mcver; - QString filename; -}; +#include "logic/forge/ForgeVersion.h" class ForgeVersionList : public BaseVersionList { diff --git a/logic/net/ForgeXzDownload.cpp b/logic/forge/ForgeXzDownload.cpp index 359ad858..359ad858 100644 --- a/logic/net/ForgeXzDownload.cpp +++ b/logic/forge/ForgeXzDownload.cpp diff --git a/logic/net/ForgeXzDownload.h b/logic/forge/ForgeXzDownload.h index 7bdfb6d9..f2564380 100644 --- a/logic/net/ForgeXzDownload.h +++ b/logic/forge/ForgeXzDownload.h @@ -15,8 +15,8 @@ #pragma once -#include "NetAction.h" -#include "HttpMetaCache.h" +#include "logic/net/NetAction.h" +#include "logic/net/HttpMetaCache.h" #include <QFile> #include <QTemporaryFile> #include "ForgeMirror.h" diff --git a/logic/LegacyForge.cpp b/logic/forge/LegacyForge.cpp index 94212ae4..94212ae4 100644 --- a/logic/LegacyForge.cpp +++ b/logic/forge/LegacyForge.cpp diff --git a/logic/LegacyForge.h b/logic/forge/LegacyForge.h index f4165ffa..ec49f63c 100644 --- a/logic/LegacyForge.h +++ b/logic/forge/LegacyForge.h @@ -15,7 +15,7 @@ #pragma once -#include "Mod.h" +#include "logic/Mod.h" class MinecraftForge : public Mod { diff --git a/logic/lists/MinecraftVersionList.cpp b/logic/lists/MinecraftVersionList.cpp index b9d60c61..ec2f2d21 100644 --- a/logic/lists/MinecraftVersionList.cpp +++ b/logic/lists/MinecraftVersionList.cpp @@ -212,6 +212,7 @@ void MCVListLoadTask::list_downloaded() { bool is_snapshot = false; bool is_latest = false; + bool legacyLaunch = false; // Load the version info. if (!versions[i].isObject()) @@ -236,32 +237,28 @@ void MCVListLoadTask::list_downloaded() // FIXME: log this somewhere continue; } - // Parse the type. - MinecraftVersion::VersionType versionType; // OneSix or Legacy. use filter to determine type if (versionTypeStr == "release") { - versionType = legacyWhitelist.contains(versionID) ? MinecraftVersion::Legacy - : MinecraftVersion::OneSix; + legacyLaunch = legacyWhitelist.contains(versionID); is_latest = (versionID == latestReleaseID); is_snapshot = false; } else if (versionTypeStr == "snapshot") // It's a snapshot... yay { - versionType = legacyWhitelist.contains(versionID) ? MinecraftVersion::Legacy - : MinecraftVersion::OneSix; + legacyLaunch = legacyWhitelist.contains(versionID); is_latest = (versionID == latestSnapshotID); is_snapshot = true; } else if (versionTypeStr == "old_alpha") { - versionType = MinecraftVersion::Nostalgia; + legacyLaunch = false; is_latest = false; is_snapshot = false; } else if (versionTypeStr == "old_beta") { - versionType = MinecraftVersion::Legacy; + legacyLaunch = true; is_latest = false; is_snapshot = false; } @@ -280,7 +277,8 @@ void MCVListLoadTask::list_downloaded() mcVersion->download_url = dlUrl; mcVersion->is_latest = is_latest; mcVersion->is_snapshot = is_snapshot; - mcVersion->type = versionType; + if(legacyLaunch) + mcVersion->features.insert("legacy"); tempList.append(mcVersion); } m_list->updateListData(tempList); diff --git a/logic/LiteLoaderInstaller.cpp b/logic/liteloader/LiteLoaderInstaller.cpp index 99cc5643..1a94e644 100644 --- a/logic/LiteLoaderInstaller.cpp +++ b/logic/liteloader/LiteLoaderInstaller.cpp @@ -20,11 +20,11 @@ #include "logger/QsLog.h" -#include "VersionFinal.h" -#include "OneSixLibrary.h" -#include "OneSixInstance.h" +#include "logic/VersionFinal.h" +#include "logic/OneSixLibrary.h" +#include "logic/OneSixInstance.h" #include "MultiMC.h" -#include "lists/LiteLoaderVersionList.h" +#include "logic/liteloader/LiteLoaderVersionList.h" LiteLoaderInstaller::LiteLoaderInstaller() : BaseInstaller() { diff --git a/logic/LiteLoaderInstaller.h b/logic/liteloader/LiteLoaderInstaller.h index 3ab5acb2..43ad6b83 100644 --- a/logic/LiteLoaderInstaller.h +++ b/logic/liteloader/LiteLoaderInstaller.h @@ -15,12 +15,11 @@ #pragma once -#include "BaseInstaller.h" - #include <QString> #include <QMap> -#include "logic/lists/LiteLoaderVersionList.h" +#include "logic/BaseInstaller.h" +#include "logic/liteloader/LiteLoaderVersionList.h" class LiteLoaderInstaller : public BaseInstaller { diff --git a/logic/lists/LiteLoaderVersionList.cpp b/logic/liteloader/LiteLoaderVersionList.cpp index ef95eefd..ef95eefd 100644 --- a/logic/lists/LiteLoaderVersionList.cpp +++ b/logic/liteloader/LiteLoaderVersionList.cpp diff --git a/logic/lists/LiteLoaderVersionList.h b/logic/liteloader/LiteLoaderVersionList.h index bfc913e5..aa35f1ca 100644 --- a/logic/lists/LiteLoaderVersionList.h +++ b/logic/liteloader/LiteLoaderVersionList.h @@ -19,10 +19,10 @@ #include <QString> #include <QStringList> -#include "BaseVersionList.h" +#include "logic/lists/BaseVersionList.h" #include "logic/tasks/Task.h" #include "logic/BaseVersion.h" -#include <logic/net/NetJob.h> +#include "logic/net/NetJob.h" class LLListLoadTask; class QNetworkReply; diff --git a/logic/net/NetJob.h b/logic/net/NetJob.h index 2df8428b..66bf7fb6 100644 --- a/logic/net/NetJob.h +++ b/logic/net/NetJob.h @@ -21,7 +21,7 @@ #include "MD5EtagDownload.h" #include "CacheDownload.h" #include "HttpMetaCache.h" -#include "ForgeXzDownload.h" +//#include "logic/forge/ForgeXzDownload.h" #include "logic/tasks/ProgressProvider.h" class NetJob; |