diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-12-08 22:06:04 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-12-08 22:06:04 +0100 |
commit | b0dbd4f4afcf60e4021cbb3218bfe280c4989859 (patch) | |
tree | c8ca3fd733e04ef7c0f064089782724db312f4a1 /logic/auth | |
parent | 9410dd042ea62224fa3e0eb3b525abbdf0c316ee (diff) | |
download | MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.tar MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.tar.gz MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.tar.lz MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.tar.xz MultiMC-b0dbd4f4afcf60e4021cbb3218bfe280c4989859.zip |
Fix offline mode bugs
Diffstat (limited to 'logic/auth')
-rw-r--r-- | logic/auth/MojangAccount.h | 4 | ||||
-rw-r--r-- | logic/auth/YggdrasilTask.cpp | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/logic/auth/MojangAccount.h b/logic/auth/MojangAccount.h index 8c44ce58..95f777ce 100644 --- a/logic/auth/MojangAccount.h +++ b/logic/auth/MojangAccount.h @@ -97,6 +97,10 @@ public: /* manipulation */ */ std::shared_ptr<Task> login(QString password = QString()); + void downgrade() + { + m_online = false; + } public: /* queries */ const QString &username() const { diff --git a/logic/auth/YggdrasilTask.cpp b/logic/auth/YggdrasilTask.cpp index 6b938ea7..45155058 100644 --- a/logic/auth/YggdrasilTask.cpp +++ b/logic/auth/YggdrasilTask.cpp @@ -78,7 +78,9 @@ void YggdrasilTask::processReply() { setStatus(getStateMessage(STATE_PROCESSING_RESPONSE)); - if (m_netReply->error() == QNetworkReply::OperationCanceledError) + // any network errors lead to offline mode right now + if (m_netReply->error() >= QNetworkReply::ConnectionRefusedError && + m_netReply->error() <= QNetworkReply::UnknownNetworkError) { // WARNING/FIXME: the value here is used in MojangAccount to detect the cancel/timeout emitFailed("Yggdrasil task cancelled."); |