mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-04-17 07:47:00 -04:00
37 lines
797 B
C++
37 lines
797 B
C++
#include "AuthSession.h"
|
|
#include <QJsonArray>
|
|
#include <QJsonDocument>
|
|
#include <QJsonObject>
|
|
#include <QStringList>
|
|
|
|
QString AuthSession::serializeUserProperties()
|
|
{
|
|
QJsonObject userAttrs;
|
|
/*
|
|
for (auto key : u.properties.keys())
|
|
{
|
|
auto array = QJsonArray::fromStringList(u.properties.values(key));
|
|
userAttrs.insert(key, array);
|
|
}
|
|
*/
|
|
QJsonDocument value(userAttrs);
|
|
return value.toJson(QJsonDocument::Compact);
|
|
}
|
|
|
|
bool AuthSession::MakeOffline(QString offline_playername)
|
|
{
|
|
session = "-";
|
|
access_token = "0";
|
|
player_name = offline_playername;
|
|
return true;
|
|
}
|
|
|
|
void AuthSession::MakeDemo(QString name, QString u)
|
|
{
|
|
uuid = u;
|
|
session = "-";
|
|
access_token = "0";
|
|
player_name = name;
|
|
launchMode = LaunchMode::Demo;
|
|
};
|