From 94fdf13f4a113bb1ffc75a4862308f12c904b2c4 Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Thu, 30 Dec 2021 21:26:29 +0100 Subject: NOISSUE proper fix for missing profile + demo mode --- launcher/minecraft/auth/AuthSession.cpp | 5 +++++ launcher/minecraft/auth/AuthSession.h | 4 ++++ launcher/minecraft/auth/Parsers.cpp | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'launcher/minecraft/auth') diff --git a/launcher/minecraft/auth/AuthSession.cpp b/launcher/minecraft/auth/AuthSession.cpp index d44f9098..6bea74a3 100644 --- a/launcher/minecraft/auth/AuthSession.cpp +++ b/launcher/minecraft/auth/AuthSession.cpp @@ -30,3 +30,8 @@ bool AuthSession::MakeOffline(QString offline_playername) status = PlayableOffline; return true; } + +void AuthSession::MakeDemo() { + player_name = "Player"; + demo = true; +} diff --git a/launcher/minecraft/auth/AuthSession.h b/launcher/minecraft/auth/AuthSession.h index 55fbdf39..a75df506 100644 --- a/launcher/minecraft/auth/AuthSession.h +++ b/launcher/minecraft/auth/AuthSession.h @@ -11,6 +11,7 @@ class QNetworkAccessManager; struct AuthSession { bool MakeOffline(QString offline_playername); + void MakeDemo(); QString serializeUserProperties(); @@ -43,6 +44,9 @@ struct AuthSession bool auth_server_online = false; // Did the user request online mode? bool wants_online = true; + + //Is this a demo session? + bool demo = false; }; typedef std::shared_ptr AuthSessionPtr; diff --git a/launcher/minecraft/auth/Parsers.cpp b/launcher/minecraft/auth/Parsers.cpp index 2b189fe4..ed31e934 100644 --- a/launcher/minecraft/auth/Parsers.cpp +++ b/launcher/minecraft/auth/Parsers.cpp @@ -227,7 +227,7 @@ bool parseMinecraftEntitlements(QByteArray & data, MinecraftEntitlement &output) auto obj = doc.object(); output.canPlayMinecraft = false; - output.ownsMinecraft = true; + output.ownsMinecraft = false; auto itemsArray = obj.value("items").toArray(); for(auto item: itemsArray) { -- cgit