PrismLauncher/launcher/minecraft/auth/AuthSession.cpp
Josiah Glosson 862f4fb061 Make Launch Offline not launch online in 1.6+
Signed-off-by: Josiah Glosson <soujournme@gmail.com>
(cherry picked from commit 1fbb41f5e2)
2023-07-18 21:40:28 +00:00

39 lines
830 B
C++

#include "AuthSession.h"
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#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)
{
if (status != PlayableOffline && status != PlayableOnline)
{
return false;
}
session = "-";
access_token = "0";
player_name = offline_playername;
status = PlayableOffline;
return true;
}
void AuthSession::MakeDemo() {
player_name = "Player";
demo = true;
}