Offline mode support, part 1

Refactor MojangAccount so it exposes a less generic interface and supports login. Hide the ugly details.
Yggdrasil tasks are now only used from MojangAccount.
This commit is contained in:
Petr Mrázek
2013-12-05 02:39:52 +01:00
parent 613699b362
commit f028aa76bc
18 changed files with 265 additions and 322 deletions

View File

@ -20,7 +20,6 @@
#include <logger/QsLog.h>
#include <logic/auth/flows/AuthenticateTask.h>
#include <logic/net/NetJob.h>
#include <gui/dialogs/EditAccountDialog.h>
@ -117,8 +116,8 @@ void AccountListDialog::addAccount(const QString& errMsg)
QString username(loginDialog.username());
QString password(loginDialog.password());
MojangAccountPtr account = MojangAccountPtr(new MojangAccount(username));
MojangAccountPtr account = MojangAccount::createFromUsername(username);
/*
ProgressDialog progDialog(this);
AuthenticateTask authTask(account, password, &progDialog);
if (progDialog.exec(&authTask))
@ -132,9 +131,9 @@ void AccountListDialog::addAccount(const QString& errMsg)
for(AccountProfile profile : account->profiles())
{
auto meta = MMC->metacache()->resolveEntry("skins", profile.name() + ".png");
auto meta = MMC->metacache()->resolveEntry("skins", profile.name + ".png");
auto action = CacheDownload::make(
QUrl("http://skins.minecraft.net/MinecraftSkins/" + profile.name() + ".png"),
QUrl("http://skins.minecraft.net/MinecraftSkins/" + profile.name + ".png"),
meta);
job->addNetAction(action);
meta->stale = true;
@ -142,5 +141,6 @@ void AccountListDialog::addAccount(const QString& errMsg)
job->start();
}
*/
}
}

View File

@ -20,8 +20,6 @@
#include <logger/QsLog.h>
#include <logic/auth/flows/AuthenticateTask.h>
#include <gui/dialogs/ProgressDialog.h>
#include <MultiMC.h>