| 346 | } |
| 347 | |
| 348 | QJsonObject AccountData::saveState() const { |
| 349 | QJsonObject output; |
| 350 | if(type == AccountType::Mojang) { |
| 351 | output["type"] = "Mojang"; |
| 352 | if(legacy) { |
| 353 | output["legacy"] = true; |
| 354 | } |
| 355 | if(canMigrateToMSA) { |
| 356 | output["canMigrateToMSA"] = true; |
| 357 | } |
| 358 | } |
| 359 | else if (type == AccountType::MSA) { |
| 360 | output["type"] = "MSA"; |
| 361 | tokenToJSONV3(output, msaToken, "msa"); |
| 362 | tokenToJSONV3(output, userToken, "utoken"); |
| 363 | tokenToJSONV3(output, xboxApiToken, "xrp-main"); |
| 364 | tokenToJSONV3(output, mojangservicesToken, "xrp-mc"); |
| 365 | } |
| 366 | |
| 367 | tokenToJSONV3(output, yggdrasilToken, "ygg"); |
| 368 | profileToJSONV3(output, minecraftProfile, "profile"); |
| 369 | entitlementToJSONV3(output, minecraftEntitlement); |
| 370 | return output; |
| 371 | } |
| 372 | |
| 373 | QString AccountData::userName() const { |
| 374 | if(type != AccountType::Mojang) { |
no test coverage detected