summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-06-28 21:34:56 +0200
committerPetr Mrázek <peterix@gmail.com>2018-06-28 21:34:56 +0200
commitb5f636b3d57a63f634c4efe5a4ccd9a91f53df04 (patch)
treee251a4725feefd93d99ebc62b150bce2a60ecda2 /api/logic/minecraft
parent19bb50b872da2702b8e0b65f3f7b6b54c1c5b071 (diff)
downloadMultiMC-b5f636b3d57a63f634c4efe5a4ccd9a91f53df04.tar
MultiMC-b5f636b3d57a63f634c4efe5a4ccd9a91f53df04.tar.gz
MultiMC-b5f636b3d57a63f634c4efe5a4ccd9a91f53df04.tar.lz
MultiMC-b5f636b3d57a63f634c4efe5a4ccd9a91f53df04.tar.xz
MultiMC-b5f636b3d57a63f634c4efe5a4ccd9a91f53df04.zip
NOISSUE do not keep downloads in memory, add (some) missing virtual dtors
Diffstat (limited to 'api/logic/minecraft')
-rw-r--r--api/logic/minecraft/MinecraftLoadAndCheck.h1
-rw-r--r--api/logic/minecraft/MinecraftUpdate.h2
-rw-r--r--api/logic/minecraft/SkinUpload.h1
-rw-r--r--api/logic/minecraft/auth/YggdrasilTask.h1
-rw-r--r--api/logic/minecraft/launch/ClaimAccount.h2
-rw-r--r--api/logic/minecraft/launch/CreateServerResourcePacksFolder.h2
-rw-r--r--api/logic/minecraft/launch/DirectJavaLaunch.h2
-rw-r--r--api/logic/minecraft/launch/LauncherPartLaunch.h2
-rw-r--r--api/logic/minecraft/legacy/LegacyInstance.cpp80
-rw-r--r--api/logic/minecraft/update/AssetUpdateTask.cpp5
-rw-r--r--api/logic/minecraft/update/AssetUpdateTask.h2
-rw-r--r--api/logic/minecraft/update/FMLLibrariesTask.h1
-rw-r--r--api/logic/minecraft/update/FoldersTask.h2
-rw-r--r--api/logic/minecraft/update/LibrariesTask.h1
14 files changed, 23 insertions, 81 deletions
diff --git a/api/logic/minecraft/MinecraftLoadAndCheck.h b/api/logic/minecraft/MinecraftLoadAndCheck.h
index 00515f2d..91aed674 100644
--- a/api/logic/minecraft/MinecraftLoadAndCheck.h
+++ b/api/logic/minecraft/MinecraftLoadAndCheck.h
@@ -32,6 +32,7 @@ class MinecraftLoadAndCheck : public Task
Q_OBJECT
public:
explicit MinecraftLoadAndCheck(MinecraftInstance *inst, QObject *parent = 0);
+ virtual ~MinecraftLoadAndCheck() {};
void executeTask() override;
private slots:
diff --git a/api/logic/minecraft/MinecraftUpdate.h b/api/logic/minecraft/MinecraftUpdate.h
index 78c02049..543b2f64 100644
--- a/api/logic/minecraft/MinecraftUpdate.h
+++ b/api/logic/minecraft/MinecraftUpdate.h
@@ -32,6 +32,8 @@ class OneSixUpdate : public Task
Q_OBJECT
public:
explicit OneSixUpdate(MinecraftInstance *inst, QObject *parent = 0);
+ virtual ~OneSixUpdate() {};
+
void executeTask() override;
bool canAbort() const override;
diff --git a/api/logic/minecraft/SkinUpload.h b/api/logic/minecraft/SkinUpload.h
index 5b331fa9..c47283b1 100644
--- a/api/logic/minecraft/SkinUpload.h
+++ b/api/logic/minecraft/SkinUpload.h
@@ -21,7 +21,6 @@ public:
// Note this class takes ownership of the file.
SkinUpload(QObject *parent, AuthSessionPtr session, QByteArray skin, Model model = STEVE);
-
virtual ~SkinUpload() {}
private:
diff --git a/api/logic/minecraft/auth/YggdrasilTask.h b/api/logic/minecraft/auth/YggdrasilTask.h
index b165d3e9..b5d6af13 100644
--- a/api/logic/minecraft/auth/YggdrasilTask.h
+++ b/api/logic/minecraft/auth/YggdrasilTask.h
@@ -34,6 +34,7 @@ class YggdrasilTask : public Task
Q_OBJECT
public:
explicit YggdrasilTask(MojangAccount * account, QObject *parent = 0);
+ virtual ~YggdrasilTask() {};
/**
* assign a session to this task. the session will be filled with required infomration
diff --git a/api/logic/minecraft/launch/ClaimAccount.h b/api/logic/minecraft/launch/ClaimAccount.h
index de9007d1..c11c2128 100644
--- a/api/logic/minecraft/launch/ClaimAccount.h
+++ b/api/logic/minecraft/launch/ClaimAccount.h
@@ -23,6 +23,8 @@ class ClaimAccount: public LaunchStep
Q_OBJECT
public:
explicit ClaimAccount(LaunchTask *parent, AuthSessionPtr session);
+ virtual ~ClaimAccount() {};
+
void executeTask() override;
void finalize() override;
bool canAbort() const override
diff --git a/api/logic/minecraft/launch/CreateServerResourcePacksFolder.h b/api/logic/minecraft/launch/CreateServerResourcePacksFolder.h
index 92026ecb..1e7b6621 100644
--- a/api/logic/minecraft/launch/CreateServerResourcePacksFolder.h
+++ b/api/logic/minecraft/launch/CreateServerResourcePacksFolder.h
@@ -25,6 +25,8 @@ class CreateServerResourcePacksFolder: public LaunchStep
Q_OBJECT
public:
explicit CreateServerResourcePacksFolder(LaunchTask *parent);
+ virtual ~CreateServerResourcePacksFolder() {};
+
virtual void executeTask();
virtual bool canAbort() const
{
diff --git a/api/logic/minecraft/launch/DirectJavaLaunch.h b/api/logic/minecraft/launch/DirectJavaLaunch.h
index 19087b50..8d2cc467 100644
--- a/api/logic/minecraft/launch/DirectJavaLaunch.h
+++ b/api/logic/minecraft/launch/DirectJavaLaunch.h
@@ -24,6 +24,8 @@ class DirectJavaLaunch: public LaunchStep
Q_OBJECT
public:
explicit DirectJavaLaunch(LaunchTask *parent);
+ virtual ~DirectJavaLaunch() {};
+
virtual void executeTask();
virtual bool abort();
virtual void proceed();
diff --git a/api/logic/minecraft/launch/LauncherPartLaunch.h b/api/logic/minecraft/launch/LauncherPartLaunch.h
index d384c2d1..6ae85a3f 100644
--- a/api/logic/minecraft/launch/LauncherPartLaunch.h
+++ b/api/logic/minecraft/launch/LauncherPartLaunch.h
@@ -24,6 +24,8 @@ class LauncherPartLaunch: public LaunchStep
Q_OBJECT
public:
explicit LauncherPartLaunch(LaunchTask *parent);
+ virtual ~LauncherPartLaunch() {};
+
virtual void executeTask();
virtual bool abort();
virtual void proceed();
diff --git a/api/logic/minecraft/legacy/LegacyInstance.cpp b/api/logic/minecraft/legacy/LegacyInstance.cpp
index 5338763c..6e6d9ae6 100644
--- a/api/logic/minecraft/legacy/LegacyInstance.cpp
+++ b/api/logic/minecraft/legacy/LegacyInstance.cpp
@@ -96,86 +96,6 @@ shared_qobject_ptr<Task> LegacyInstance::createUpdateTask(Net::Mode)
return nullptr;
}
-/*
-class LegacyJarModTask : public Task
-{
- //Q_OBJECT
-public:
- explicit LegacyJarModTask(std::shared_ptr<LegacyInstance> inst) : Task(nullptr), m_inst(inst)
- {
- }
- virtual void executeTask()
- {
- if (!m_inst->shouldRebuild())
- {
- emitSucceeded();
- return;
- }
-
- // Get the mod list
- auto modList = m_inst->getJarMods();
-
- QFileInfo runnableJar(m_inst->runnableJar());
- QFileInfo baseJar(m_inst->baseJar());
- bool base_is_custom = m_inst->shouldUseCustomBaseJar();
-
- // Nothing to do if there are no jar mods to install, no backup and just the mc jar
- if (base_is_custom)
- {
- // yes, this can happen if the instance only has the runnable jar and not the base jar
- // it *could* be assumed that such an instance is vanilla, but that wouldn't be safe
- // because that's not something mmc4 guarantees
- if (runnableJar.isFile() && !baseJar.exists() && modList.empty())
- {
- m_inst->setShouldRebuild(false);
- emitSucceeded();
- return;
- }
-
- setStatus(tr("Installing mods: Backing up minecraft.jar ..."));
- if (!baseJar.exists() && !QFile::copy(runnableJar.filePath(), baseJar.filePath()))
- {
- emitFailed("It seems both the active and base jar are gone. A fresh base jar will "
- "be used on next run.");
- m_inst->setShouldRebuild(true);
- m_inst->setShouldUpdate(true);
- m_inst->setShouldUseCustomBaseJar(false);
- return;
- }
- }
-
- if (!baseJar.exists())
- {
- emitFailed("The base jar " + baseJar.filePath() + " does not exist");
- return;
- }
-
- if (runnableJar.exists() && !QFile::remove(runnableJar.filePath()))
- {
- emitFailed("Failed to delete old minecraft.jar");
- return;
- }
-
- setStatus(tr("Installing mods: Opening minecraft.jar ..."));
-
- QString outputJarPath = runnableJar.filePath();
- QString inputJarPath = baseJar.filePath();
-
- if(!MMCZip::createModdedJar(inputJarPath, outputJarPath, modList))
- {
- emitFailed(tr("Failed to create the custom Minecraft jar file."));
- return;
- }
- m_inst->setShouldRebuild(false);
- // inst->UpdateVersion(true);
- emitSucceeded();
- return;
-
- }
- std::shared_ptr<LegacyInstance> m_inst;
-};
-*/
-
std::shared_ptr<LegacyModList> LegacyInstance::jarModList() const
{
if (!jar_mod_list)
diff --git a/api/logic/minecraft/update/AssetUpdateTask.cpp b/api/logic/minecraft/update/AssetUpdateTask.cpp
index 2ad2b5b2..905c5b3d 100644
--- a/api/logic/minecraft/update/AssetUpdateTask.cpp
+++ b/api/logic/minecraft/update/AssetUpdateTask.cpp
@@ -9,6 +9,11 @@ AssetUpdateTask::AssetUpdateTask(MinecraftInstance * inst)
{
m_inst = inst;
}
+
+AssetUpdateTask::~AssetUpdateTask()
+{
+}
+
void AssetUpdateTask::executeTask()
{
setStatus(tr("Updating assets index..."));
diff --git a/api/logic/minecraft/update/AssetUpdateTask.h b/api/logic/minecraft/update/AssetUpdateTask.h
index c666faa6..870cede5 100644
--- a/api/logic/minecraft/update/AssetUpdateTask.h
+++ b/api/logic/minecraft/update/AssetUpdateTask.h
@@ -8,6 +8,8 @@ class AssetUpdateTask : public Task
Q_OBJECT
public:
AssetUpdateTask(MinecraftInstance * inst);
+ virtual ~AssetUpdateTask();
+
void executeTask() override;
bool canAbort() const override;
diff --git a/api/logic/minecraft/update/FMLLibrariesTask.h b/api/logic/minecraft/update/FMLLibrariesTask.h
index 85f45468..f281890d 100644
--- a/api/logic/minecraft/update/FMLLibrariesTask.h
+++ b/api/logic/minecraft/update/FMLLibrariesTask.h
@@ -10,6 +10,7 @@ class FMLLibrariesTask : public Task
Q_OBJECT
public:
FMLLibrariesTask(MinecraftInstance * inst);
+ virtual ~FMLLibrariesTask() {};
void executeTask() override;
diff --git a/api/logic/minecraft/update/FoldersTask.h b/api/logic/minecraft/update/FoldersTask.h
index 6e669b1e..e0781ad8 100644
--- a/api/logic/minecraft/update/FoldersTask.h
+++ b/api/logic/minecraft/update/FoldersTask.h
@@ -8,6 +8,8 @@ class FoldersTask : public Task
Q_OBJECT
public:
FoldersTask(MinecraftInstance * inst);
+ virtual ~FoldersTask() {};
+
void executeTask() override;
private:
MinecraftInstance *m_inst;
diff --git a/api/logic/minecraft/update/LibrariesTask.h b/api/logic/minecraft/update/LibrariesTask.h
index d06a5037..cb9babc3 100644
--- a/api/logic/minecraft/update/LibrariesTask.h
+++ b/api/logic/minecraft/update/LibrariesTask.h
@@ -8,6 +8,7 @@ class LibrariesTask : public Task
Q_OBJECT
public:
LibrariesTask(MinecraftInstance * inst);
+ virtual ~LibrariesTask() {};
void executeTask() override;