diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-03-06 01:00:44 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:19:56 +0200 |
commit | 7382360771f78e351740393262358bed3297d44c (patch) | |
tree | 3b6bddaa5916dd32c0615c61e50724dda0d7fdd9 /api | |
parent | 8cbe13c6560c3abe8ef73b8a376bd84dea281cf4 (diff) | |
download | MultiMC-7382360771f78e351740393262358bed3297d44c.tar MultiMC-7382360771f78e351740393262358bed3297d44c.tar.gz MultiMC-7382360771f78e351740393262358bed3297d44c.tar.lz MultiMC-7382360771f78e351740393262358bed3297d44c.tar.xz MultiMC-7382360771f78e351740393262358bed3297d44c.zip |
NOISSUE remove builtin Minecraft versions
Diffstat (limited to 'api')
-rw-r--r-- | api/logic/minecraft/MinecraftVersionList.cpp | 51 | ||||
-rw-r--r-- | api/logic/minecraft/MinecraftVersionList.h | 1 | ||||
-rw-r--r-- | api/logic/minecraft/VersionFilterData.cpp | 9 | ||||
-rw-r--r-- | api/logic/minecraft/VersionFilterData.h | 2 |
4 files changed, 2 insertions, 61 deletions
diff --git a/api/logic/minecraft/MinecraftVersionList.cpp b/api/logic/minecraft/MinecraftVersionList.cpp index 29fa840e..0dc46289 100644 --- a/api/logic/minecraft/MinecraftVersionList.cpp +++ b/api/logic/minecraft/MinecraftVersionList.cpp @@ -26,7 +26,6 @@ #include "ParseUtils.h" #include "ProfileUtils.h" -#include "VersionFilterData.h" #include "onesix/OneSixVersionFormat.h" #include "MojangVersionFormat.h" #include <FileSystem.h> @@ -89,7 +88,6 @@ public: MinecraftVersionList::MinecraftVersionList(QObject *parent) : BaseVersionList(parent) { - loadBuiltinList(); loadCachedList(); } @@ -159,50 +157,6 @@ void MinecraftVersionList::loadCachedList() m_hasLocalIndex = true; } -void MinecraftVersionList::loadBuiltinList() -{ - qDebug() << "Loading builtin version list."; - // grab the version list data from internal resources. - const QJsonDocument doc = - Json::requireDocument(QString(":/versions/minecraft.json"), "builtin version list"); - const QJsonObject root = doc.object(); - - // parse all the versions - for (const auto version : Json::requireArray(root.value("versions"))) - { - QJsonObject versionObj = version.toObject(); - QString versionID = versionObj.value("id").toString(""); - QString versionTypeStr = versionObj.value("type").toString(""); - if (versionID.isEmpty() || versionTypeStr.isEmpty()) - { - qCritical() << "Parsed version is missing ID or type"; - continue; - } - - // Now, we construct the version object and add it to the list. - std::shared_ptr<MinecraftVersion> mcVersion(new MinecraftVersion()); - mcVersion->m_name = mcVersion->m_descriptor = versionID; - - // Parse the timestamp. - mcVersion->m_releaseTime = timeFromS3Time(versionObj.value("releaseTime").toString("")); - mcVersion->m_versionFileURL = QString(); - mcVersion->m_versionSource = VersionSource::Builtin; - mcVersion->m_type = versionTypeStr; - mcVersion->m_appletClass = versionObj.value("appletClass").toString(""); - mcVersion->m_mainClass = versionObj.value("mainClass").toString(""); - mcVersion->m_jarChecksum = versionObj.value("checksum").toString(""); - if (versionObj.contains("+traits")) - { - for (auto traitVal : Json::requireArray(versionObj.value("+traits"))) - { - mcVersion->m_traits.insert(Json::requireString(traitVal)); - } - } - m_lookup[versionID] = mcVersion; - m_vlist.append(mcVersion); - } -} - void MinecraftVersionList::loadMojangList(QJsonDocument jsonDoc, VersionSource source) { qDebug() << "Loading" << ((source == VersionSource::Remote) ? "remote" : "local") << "version list."; @@ -259,11 +213,6 @@ void MinecraftVersionList::loadMojangList(QJsonDocument jsonDoc, VersionSource s mcVersion->m_releaseTime = timeFromS3Time(versionObj.value("releaseTime").toString("")); mcVersion->m_updateTime = timeFromS3Time(versionObj.value("time").toString("")); - if (mcVersion->m_releaseTime < g_VersionFilterData.legacyCutoffDate) - { - continue; - } - // depends on where we load the version from -- network request or local file? mcVersion->m_versionSource = source; mcVersion->m_versionFileURL = versionObj.value("url").toString(""); diff --git a/api/logic/minecraft/MinecraftVersionList.h b/api/logic/minecraft/MinecraftVersionList.h index 42333678..fc421966 100644 --- a/api/logic/minecraft/MinecraftVersionList.h +++ b/api/logic/minecraft/MinecraftVersionList.h @@ -34,7 +34,6 @@ class MULTIMC_LOGIC_EXPORT MinecraftVersionList : public BaseVersionList Q_OBJECT private: void sortInternal(); - void loadBuiltinList(); void loadMojangList(QJsonDocument jsonDoc, VersionSource source); void loadCachedList(); void saveCachedList(); diff --git a/api/logic/minecraft/VersionFilterData.cpp b/api/logic/minecraft/VersionFilterData.cpp index 60c64473..5f4ceee6 100644 --- a/api/logic/minecraft/VersionFilterData.cpp +++ b/api/logic/minecraft/VersionFilterData.cpp @@ -58,16 +58,11 @@ VersionFilterData::VersionFilterData() // don't use installers for those. forgeInstallerBlacklist = QSet<QString>({"1.5.2"}); - /* - * nothing older than this will be accepted from Mojang servers - * (these versions need to be tested by us first) - */ + + // FIXME: remove, used for deciding when core mods should display legacyCutoffDate = timeFromS3Time("2013-06-25T15:08:56+02:00"); lwjglWhitelist = QSet<QString>{"net.java.jinput:jinput", "net.java.jinput:jinput-platform", "net.java.jutils:jutils", "org.lwjgl.lwjgl:lwjgl", "org.lwjgl.lwjgl:lwjgl_util", "org.lwjgl.lwjgl:lwjgl-platform"}; - - // Version list magic - recommendedMinecraftVersion = "1.7.10"; } diff --git a/api/logic/minecraft/VersionFilterData.h b/api/logic/minecraft/VersionFilterData.h index f4213e1a..2408e704 100644 --- a/api/logic/minecraft/VersionFilterData.h +++ b/api/logic/minecraft/VersionFilterData.h @@ -24,7 +24,5 @@ struct VersionFilterData QDateTime legacyCutoffDate; // Libraries that belong to LWJGL QSet<QString> lwjglWhitelist; - // Currently recommended minecraft version - QString recommendedMinecraftVersion; }; extern VersionFilterData MULTIMC_LOGIC_EXPORT g_VersionFilterData; |