Dehardcode account providers (#38)

* Dehardcode account providers

* Fix crash on creation

* Add dynamic 'add account dialog' provider selector

* Fix typo and add newlines

* Rename loginType to provider

* Rename MojangAccount to Account and MojangAccountList to AccountList

* Fix json save error
This commit is contained in:
Max
2021-06-14 12:51:25 +03:00
committed by GitHub
parent 396400b60d
commit 167b6bd405
39 changed files with 398 additions and 261 deletions

View File

@@ -918,13 +918,10 @@ shared_qobject_ptr<LaunchTask> MinecraftInstance::createLaunchTask(AuthSessionPt
}
// authlib patch
if (session->m_accountPtr->loginType() != "mojang")
if (session->m_accountPtr->provider()->injectorEndpoint() != "")
{
auto step = new InjectAuthlib(pptr, &m_injector);
if(session->m_accountPtr->loginType() == "dummy")
step->setAuthServer(((QString)"http://localhost:%1").arg(localAuthServerPort));
else if(session->m_accountPtr->loginType() == "elyby")
step->setAuthServer(((QString) "ely.by").arg(localAuthServerPort));
step->setAuthServer(session->m_accountPtr->provider()->injectorEndpoint().arg(localAuthServerPort));
process->appendStep(step);
}