Fix login and startup logging issues

Auth uses the refresh endpoint instead of validate. This means less password entering.
Console will now only autoscroll when already scrolled all the way down.
Better conformance with the Yggdrasil auth protocol (not complete yet, but Mojang launcher isn't complete either).
Fix bug that prevented saving the account data (uninitialized variable).
Accounts can now trigger account list saving, this is used for the refresh endpoint.
This commit is contained in:
Petr Mrázek
2013-12-01 02:00:42 +01:00
parent 2eaf33816b
commit f27a6c39ea
27 changed files with 471 additions and 299 deletions

View File

@ -24,15 +24,14 @@
class QNetworkReply;
/**
* A Yggdrasil task is a task that performs an operation on a given mojang account.
*/
class YggdrasilTask : public Task
{
Q_OBJECT
Q_OBJECT
public:
explicit YggdrasilTask(MojangAccountPtr account, QObject* parent=0);
explicit YggdrasilTask(MojangAccountPtr account, QObject *parent = 0);
~YggdrasilTask();
/**
@ -49,7 +48,10 @@ public:
QString getCause() const { return m_cause; }
/// Gets the string to display in the GUI for describing this error.
QString getDisplayMessage() { return getErrorMessage(); }
QString getDisplayMessage()
{
return getErrorMessage();
}
protected:
QString m_shortError;
@ -66,7 +68,7 @@ public:
* Returns a pointer to a YggdrasilTask::Error object if an error has occurred.
* If no error has occurred, returns a null pointer.
*/
virtual Error* getError() const;
virtual Error *getError() const;
protected:
/**
@ -120,11 +122,11 @@ protected:
MojangAccountPtr m_account;
QNetworkReply* m_netReply;
QNetworkReply *m_netReply;
Error* m_error;
Error *m_error;
protected slots:
void processReply(QNetworkReply* reply);
protected
slots:
void processReply(QNetworkReply *reply);
};