Skip to content

Commit

Permalink
Merge branch 'unmojang' into unmojang-8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-goode committed Nov 16, 2023
2 parents 9430026 + 18db32d commit cdb2f09
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
26 changes: 20 additions & 6 deletions launcher/minecraft/auth/AccountData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,17 @@ bool AccountData::resumeStateFromV3(QJsonObject data)
return false;
}
auto typeS = typeV.toString();
bool needsElyByMigration = false;
if (typeS == "MSA") {
type = AccountType::MSA;
} else if (typeS == "Mojang") {
type = AccountType::Mojang;
} else if (typeS == "AuthlibInjector") {
type = AccountType::AuthlibInjector;
} else if (typeS == "Elyby") {
// Migrate legacy Ely.by accounts to authlib-injector accounts
type = AccountType::AuthlibInjector;
needsElyByMigration = true;
} else if (typeS == "Offline") {
type = AccountType::Offline;
} else {
Expand All @@ -306,12 +311,21 @@ bool AccountData::resumeStateFromV3(QJsonObject data)
}

if (type == AccountType::AuthlibInjector) {
customAuthServerUrl = data.value("customAuthServerUrl").toString();
customAccountServerUrl = data.value("customAccountServerUrl").toString();
customSessionServerUrl = data.value("customSessionServerUrl").toString();
customServicesServerUrl = data.value("customServicesServerUrl").toString();
authlibInjectorUrl = data.value("authlibInjectorUrl").toString();
authlibInjectorMetadata = data.value("authlibInjectorMetadata").toString();
if (needsElyByMigration) {
customAuthServerUrl = "https://authserver.ely.by/api/authlib-injector/authserver";
customAccountServerUrl = "https://authserver.ely.by/api/authlib-injector/api";
customSessionServerUrl = "https://authserver.ely.by/api/authlib-injector/sessionserver";
customServicesServerUrl = "https://authserver.ely.by/api/authlib-injector/minecraftservices";
authlibInjectorUrl = "https://authserver.ely.by/api/authlib-injector";
authlibInjectorMetadata = "";
} else {
customAuthServerUrl = data.value("customAuthServerUrl").toString();
customAccountServerUrl = data.value("customAccountServerUrl").toString();
customSessionServerUrl = data.value("customSessionServerUrl").toString();
customServicesServerUrl = data.value("customServicesServerUrl").toString();
authlibInjectorUrl = data.value("authlibInjectorUrl").toString();
authlibInjectorMetadata = data.value("authlibInjectorMetadata").toString();
}
}

if (type == AccountType::MSA) {
Expand Down
3 changes: 3 additions & 0 deletions launcher/minecraft/auth/MinecraftAccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ bool MinecraftAccount::shouldRefresh() const
if (isInUse()) {
return false;
}
if (data.type == AccountType::AuthlibInjector && data.authlibInjectorMetadata == "") {
return true;
}
switch (data.validity_) {
case Katabasis::Validity::Certain: {
break;
Expand Down

0 comments on commit cdb2f09

Please sign in to comment.