PrismLauncher/launcher/minecraft/launch/ClaimAccount.cpp
Sefa Eyeoglu 91ba4cf75e
chore: reformat
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-08-14 18:16:53 +02:00

27 lines
623 B
C++

#include "ClaimAccount.h"
#include <launch/LaunchTask.h>
#include "Application.h"
#include "minecraft/auth/AccountList.h"
ClaimAccount::ClaimAccount(LaunchTask* parent, AuthSessionPtr session) : LaunchStep(parent)
{
if (session->status == AuthSession::Status::PlayableOnline && !session->demo) {
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();
}