@@ -30,8 +30,13 @@ bool AuthSession::MakeOffline(QString offline_playername)
|
||||
return true;
|
||||
}
|
||||
|
||||
void AuthSession::MakeDemo()
|
||||
void AuthSession::MakeDemo(QString name, QString u)
|
||||
{
|
||||
player_name = "Player";
|
||||
wants_online = false;
|
||||
demo = true;
|
||||
}
|
||||
uuid = u;
|
||||
session = "-";
|
||||
access_token = "0";
|
||||
player_name = name;
|
||||
status = PlayableOnline; // needs online to download the assets
|
||||
};
|
||||
@@ -10,7 +10,7 @@ class QNetworkAccessManager;
|
||||
|
||||
struct AuthSession {
|
||||
bool MakeOffline(QString offline_playername);
|
||||
void MakeDemo();
|
||||
void MakeDemo(QString name, QString uuid);
|
||||
|
||||
QString serializeUserProperties();
|
||||
|
||||
|
||||
@@ -269,6 +269,8 @@ void MinecraftAccount::fillSession(AuthSessionPtr session)
|
||||
session->player_name = data.profileName();
|
||||
// profile ID
|
||||
session->uuid = data.profileId();
|
||||
if (session->uuid.isEmpty())
|
||||
session->uuid = uuidFromUsername(session->player_name).toString().remove(QRegularExpression("[{}-]"));
|
||||
// 'legacy' or 'mojang', depending on account type
|
||||
session->user_type = typeString();
|
||||
if (!session->access_token.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user