summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/auth/AuthSession.h
blob: dede90a9e70854b389f243f7e09e2c4d8ecb5793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once

#include <QString>
#include <QMultiMap>
#include <memory>

#include "multimc_logic_export.h"

struct User
{
	QString id;
	QMultiMap<QString, QString> properties;
};

struct MULTIMC_LOGIC_EXPORT AuthSession
{
	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;
};

typedef std::shared_ptr<AuthSession> AuthSessionPtr;