summaryrefslogtreecommitdiffstats
path: root/logic/LegacyInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/LegacyInstance.cpp')
-rw-r--r--logic/LegacyInstance.cpp57
1 files changed, 12 insertions, 45 deletions
diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp
index 3a337140..ab6536d0 100644
--- a/logic/LegacyInstance.cpp
+++ b/logic/LegacyInstance.cpp
@@ -44,7 +44,7 @@ LegacyInstance::LegacyInstance(const QString &rootDir, SettingsObject *settings,
settings->registerSetting(new Setting("IntendedJarVersion", ""));
}
-BaseUpdate *LegacyInstance::doUpdate()
+Task *LegacyInstance::doUpdate()
{
auto list = jarModList();
return new LegacyUpdate(this, this);
@@ -59,7 +59,7 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(MojangAccountPtr account)
pixmap.save(PathCombine(minecraftRoot(), "icon.png"), "PNG");
// extract the legacy launcher
- QFile(":/launcher/launcher.jar").copy(PathCombine(minecraftRoot(), LAUNCHER_FILE));
+ QFile(":/java/launcher.jar").copy(PathCombine(minecraftRoot(), LAUNCHER_FILE));
// set the process arguments
{
@@ -104,15 +104,15 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(MojangAccountPtr account)
args << "-jar" << LAUNCHER_FILE;
args << account->currentProfile()->name();
- args << account->accessToken();
+ args << account->sessionId();
args << windowTitle;
args << windowSize;
args << lwjgl;
- proc->setMinecraftArguments(args);
+ proc->setArguments(args);
}
// set the process work path
- proc->setMinecraftWorkdir(minecraftRoot());
+ proc->setWorkdir(minecraftRoot());
return proc;
}
@@ -227,56 +227,18 @@ QString LegacyInstance::instanceConfigFolder() const
return PathCombine(minecraftRoot(), "config");
}
-/*
-bool LegacyInstance::shouldUpdateCurrentVersion() const
-{
- QFileInfo jar(runnableJar());
- return jar.lastModified().toUTC().toMSecsSinceEpoch() != lastCurrentVersionUpdate();
-}
-
-void LegacyInstance::updateCurrentVersion(bool keepCurrent)
-{
- QFileInfo jar(runnableJar());
-
- if(!jar.exists())
- {
- setLastCurrentVersionUpdate(0);
- setCurrentVersionId("Unknown");
- return;
- }
-
- qint64 time = jar.lastModified().toUTC().toMSecsSinceEpoch();
-
- setLastCurrentVersionUpdate(time);
- if (!keepCurrent)
- {
- // TODO: Implement GetMinecraftJarVersion function.
- QString newVersion =
-"Unknown";//javautils::GetMinecraftJarVersion(jar.absoluteFilePath());
- setCurrentVersionId(newVersion);
- }
-}
-qint64 LegacyInstance::lastCurrentVersionUpdate() const
-{
- I_D(LegacyInstance);
- return d->m_settings->get ( "lastVersionUpdate" ).value<qint64>();
-}
-void LegacyInstance::setLastCurrentVersionUpdate ( qint64 val )
-{
- I_D(LegacyInstance);
- d->m_settings->set ( "lastVersionUpdate", val );
-}
-*/
bool LegacyInstance::shouldRebuild() const
{
I_D(LegacyInstance);
return d->m_settings->get("NeedsRebuild").toBool();
}
+
void LegacyInstance::setShouldRebuild(bool val)
{
I_D(LegacyInstance);
d->m_settings->set("NeedsRebuild", val);
}
+
QString LegacyInstance::currentVersionId() const
{
I_D(LegacyInstance);
@@ -294,22 +256,26 @@ QString LegacyInstance::lwjglVersion() const
I_D(LegacyInstance);
return d->m_settings->get("LwjglVersion").toString();
}
+
void LegacyInstance::setLWJGLVersion(QString val)
{
I_D(LegacyInstance);
d->m_settings->set("LwjglVersion", val);
}
+
QString LegacyInstance::intendedVersionId() const
{
I_D(LegacyInstance);
return d->m_settings->get("IntendedJarVersion").toString();
}
+
bool LegacyInstance::setIntendedVersionId(QString version)
{
settings().set("IntendedJarVersion", version);
setShouldUpdate(true);
return true;
}
+
bool LegacyInstance::shouldUpdate() const
{
I_D(LegacyInstance);
@@ -320,6 +286,7 @@ bool LegacyInstance::shouldUpdate() const
}
return true;
}
+
void LegacyInstance::setShouldUpdate(bool val)
{
settings().set("ShouldUpdate", val);