Add offline mode support
This commit is contained in:
parent
d4b522b6cb
commit
a1ff3b1ee3
12 changed files with 144 additions and 5 deletions
|
@ -73,6 +73,8 @@ public: /* construction */
|
|||
|
||||
static MinecraftAccountPtr createBlankMSA();
|
||||
|
||||
static MinecraftAccountPtr createOffline(const QString &username);
|
||||
|
||||
static MinecraftAccountPtr loadFromJsonV2(const QJsonObject &json);
|
||||
static MinecraftAccountPtr loadFromJsonV3(const QJsonObject &json);
|
||||
|
||||
|
@ -89,6 +91,8 @@ public: /* manipulation */
|
|||
|
||||
shared_qobject_ptr<AccountTask> loginMSA();
|
||||
|
||||
shared_qobject_ptr<AccountTask> loginOffline();
|
||||
|
||||
shared_qobject_ptr<AccountTask> refresh();
|
||||
|
||||
shared_qobject_ptr<AccountTask> currentTask();
|
||||
|
@ -128,6 +132,10 @@ public: /* queries */
|
|||
return data.type == AccountType::MSA;
|
||||
}
|
||||
|
||||
bool isOffline() const {
|
||||
return data.type == AccountType::Offline;
|
||||
}
|
||||
|
||||
bool ownsMinecraft() const {
|
||||
return data.minecraftEntitlement.ownsMinecraft;
|
||||
}
|
||||
|
@ -149,6 +157,10 @@ public: /* queries */
|
|||
return "msa";
|
||||
}
|
||||
break;
|
||||
case AccountType::Offline: {
|
||||
return "offline";
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
return "unknown";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue