2014-01-27 07:30:49 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QMultiMap>
|
|
|
|
#include <memory>
|
|
|
|
|
2016-11-15 07:21:22 +05:30
|
|
|
class MojangAccount;
|
|
|
|
|
2014-01-27 07:30:49 +05:30
|
|
|
struct User
|
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
QString id;
|
|
|
|
QMultiMap<QString, QString> properties;
|
2014-01-27 07:30:49 +05:30
|
|
|
};
|
|
|
|
|
2021-07-25 22:41:59 +05:30
|
|
|
struct AuthSession
|
2014-01-27 07:30:49 +05:30
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
bool MakeOffline(QString offline_playername);
|
|
|
|
|
|
|
|
QString serializeUserProperties();
|
|
|
|
|
|
|
|
enum Status
|
|
|
|
{
|
|
|
|
Undetermined,
|
|
|
|
RequiresPassword,
|
|
|
|
PlayableOffline,
|
|
|
|
PlayableOnline
|
|
|
|
} status = Undetermined;
|
|
|
|
|
|
|
|
User u;
|
|
|
|
|
|
|
|
// client token
|
|
|
|
QString client_token;
|
|
|
|
// account user name
|
|
|
|
QString username;
|
|
|
|
// combined session ID
|
|
|
|
QString session;
|
|
|
|
// volatile auth token
|
|
|
|
QString access_token;
|
|
|
|
// profile name
|
|
|
|
QString player_name;
|
|
|
|
// profile ID
|
|
|
|
QString uuid;
|
|
|
|
// 'legacy' or 'mojang', depending on account type
|
|
|
|
QString user_type;
|
|
|
|
// Did the auth server reply?
|
|
|
|
bool auth_server_online = false;
|
|
|
|
// Did the user request online mode?
|
|
|
|
bool wants_online = true;
|
|
|
|
std::shared_ptr<MojangAccount> m_accountPtr;
|
2014-01-27 07:30:49 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::shared_ptr<AuthSession> AuthSessionPtr;
|