PrismLauncher/launcher/minecraft/launch/ClaimAccount.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
623 B
C++
Raw Normal View History

#include "ClaimAccount.h"
#include <launch/LaunchTask.h>
2021-11-20 15:22:22 +00:00
#include "Application.h"
#include "minecraft/auth/AccountList.h"
ClaimAccount::ClaimAccount(LaunchTask* parent, AuthSessionPtr session) : LaunchStep(parent)
{
if (session->status == AuthSession::Status::PlayableOnline && !session->demo) {
2021-11-20 15:22:22 +00:00
auto accounts = APPLICATION->accounts();
m_account = accounts->getAccountByProfileName(session->player_name);
}
}
void ClaimAccount::executeTask()
{
if (m_account) {
lock.reset(new UseLock(m_account));
emitSucceeded();
}
}
void ClaimAccount::finalize()
{
lock.reset();
}