MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / tryNext

Method tryNext

launcher/minecraft/auth/AccountList.cpp:719–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717
718
719void AccountList::tryNext() {
720 while (m_refreshQueue.length()) {
721 auto accountId = m_refreshQueue.front();
722 m_refreshQueue.pop_front();
723 for(int i = 0; i < count(); i++) {
724 auto account = at(i);
725 if(account->internalId() == accountId) {
726 m_currentTask = account->refresh();
727 if(m_currentTask) {
728 connect(m_currentTask.get(), &AccountTask::succeeded, this, &AccountList::authSucceeded);
729 connect(m_currentTask.get(), &AccountTask::failed, this, &AccountList::authFailed);
730 m_currentTask->start();
731 qDebug() << "RefreshSchedule: Processing account " << account->accountDisplayString() << " with internal ID " << accountId;
732 return;
733 }
734 }
735 }
736 qDebug() << "RefreshSchedule: Account with with internal ID " << accountId << " not found.";
737 }
738 // if we get here, no account needed refreshing. Schedule refresh in an hour.
739 m_refreshTimer->start(1000 * 3600);
740}
741
742void AccountList::authSucceeded() {
743 qDebug() << "RefreshSchedule: Background account refresh succeeded";

Callers

nothing calls this directly

Calls 6

lengthMethod · 0.80
internalIdMethod · 0.80
refreshMethod · 0.45
getMethod · 0.45
startMethod · 0.45
accountDisplayStringMethod · 0.45

Tested by

no test coverage detected