mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-11-20 08:10:11 +00:00
29 lines
628 B
C++
29 lines
628 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();
|
|
}
|