mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 10:00:44 +08:00
* feat: add restart logic when login errors * fix: address sourcery review * fix: address account switcher issue * fix: addres review * chore: revert debug value * style: cleanup * perf: 简化重启客户端逻辑, 移除独立设置项 * perf: 重启客户端遵守启动客户端选项 * chore: clarified logging --------- Co-authored-by: status102 <102887808+status102@users.noreply.github.com>
30 lines
772 B
C++
30 lines
772 B
C++
#pragma once
|
|
#include "Task/InterfaceTask.h"
|
|
|
|
namespace asst
|
|
{
|
|
class StartGameTaskPlugin;
|
|
class ProcessTask;
|
|
class AccountSwitchTask;
|
|
|
|
class StartUpTask final : public InterfaceTask
|
|
{
|
|
public:
|
|
inline static constexpr std::string_view TaskType = "StartUp";
|
|
|
|
StartUpTask(const AsstCallback& callback, Assistant* inst);
|
|
virtual ~StartUpTask() override = default;
|
|
|
|
virtual bool run() override;
|
|
bool set_params(const json::value& params) override;
|
|
|
|
private:
|
|
std::shared_ptr<StartGameTaskPlugin> m_start_game_task_ptr = nullptr;
|
|
std::shared_ptr<ProcessTask> m_start_up_task_ptr = nullptr;
|
|
std::shared_ptr<AccountSwitchTask> m_account_switch_task_ptr = nullptr;
|
|
|
|
bool m_start_game = false;
|
|
static constexpr int MaxRestartAttempts = 5;
|
|
};
|
|
}
|