summaryrefslogtreecommitdiffstats
path: root/gui/MainWindow.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-08 22:06:04 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-08 22:06:04 +0100
commitb0dbd4f4afcf60e4021cbb3218bfe280c4989859 (patch)
treec8ca3fd733e04ef7c0f064089782724db312f4a1 /gui/MainWindow.cpp
parent9410dd042ea62224fa3e0eb3b525abbdf0c316ee (diff)
downloadMultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.tar
MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.tar.gz
MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.tar.lz
MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.tar.xz
MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.zip
Fix offline mode bugs
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r--gui/MainWindow.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp
index fd35e94e..bf2ce6b4 100644
--- a/gui/MainWindow.cpp
+++ b/gui/MainWindow.cpp
@@ -791,16 +791,13 @@ void MainWindow::doLaunch()
progDialog.exec(task.get());
auto status = account->accountStatus();
- if(status == Online) // Online mode! Refresh the token.
+ if(status != NotVerified)
{
updateInstance(m_selectedInstance, account);
- return;
- }
- else if(status == Verified) // Offline mode with a verified account
- {
- launchInstance(m_selectedInstance, account);
- return;
}
+ // revert from online to verified.
+ account->downgrade();
+ return;
}
if (loginWithPassword(account, tr("Your account is currently not logged in. Please enter your password to log in again.")))
updateInstance(m_selectedInstance, account);
@@ -828,7 +825,8 @@ bool MainWindow::loginWithPassword(MojangAccountPtr account, const QString& erro
void MainWindow::updateInstance(BaseInstance* instance, MojangAccountPtr account)
{
- auto updateTask = instance->doUpdate(true);
+ bool only_prepare = account->accountStatus() != Online;
+ auto updateTask = instance->doUpdate(only_prepare);
if (!updateTask)
{
launchInstance(instance, account);