Remove some old forge hacks

Forge apparently removed all `.pack.xz` files without warning.
It broke a bunch of stuff, as always. But it also means we don't need some ugly code anymore.

This is removed:

- Support for 'forge-pack-xz' and the forge-specific file download compression.
- The pack200 library we no longer need.

This stays:

- The LZMA decompression library - we may still want to use it.
This commit is contained in:
Petr Mrázek
2020-05-19 15:13:16 +02:00
parent 9eaa636908
commit e7f79c9076
26 changed files with 10 additions and 10528 deletions

View File

@ -3,7 +3,6 @@
#include <net/Download.h>
#include <net/ChecksumValidator.h>
#include <minecraft/forge/ForgeXzDownload.h>
#include <Env.h>
#include <FileSystem.h>
@ -88,26 +87,19 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(
{
options |= Net::Download::Option::AcceptLocalFiles;
}
if (isForge())
if(sha1.size())
{
qDebug() << "XzDownload for:" << rawName() << "storage:" << storage << "url:" << url;
out.append(ForgeXzDownload::make(url, storage, entry));
auto rawSha1 = QByteArray::fromHex(sha1.toLatin1());
auto dl = Net::Download::makeCached(url, entry, options);
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
qDebug() << "Checksummed Download for:" << rawName() << "storage:" << storage << "url:" << url;
out.append(dl);
}
else
{
if(sha1.size())
{
auto rawSha1 = QByteArray::fromHex(sha1.toLatin1());
auto dl = Net::Download::makeCached(url, entry, options);
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
qDebug() << "Checksummed Download for:" << rawName() << "storage:" << storage << "url:" << url;
out.append(dl);
}
else
{
out.append(Net::Download::makeCached(url, entry, options));
qDebug() << "Download for:" << rawName() << "storage:" << storage << "url:" << url;
}
out.append(Net::Download::makeCached(url, entry, options));
qDebug() << "Download for:" << rawName() << "storage:" << storage << "url:" << url;
}
return true;
};
@ -243,11 +235,6 @@ bool Library::isAlwaysStale() const
return m_hint == "always-stale";
}
bool Library::isForge() const
{
return m_hint == "forge-pack-xz";
}
void Library::setStoragePrefix(QString prefix)
{
m_storagePrefix = prefix;