fix. 极端网络下公招不调整时间

This commit is contained in:
mslxl
2022-03-21 17:53:47 +08:00
parent a85211149e
commit 09daf2689c
3 changed files with 26 additions and 2 deletions

View File

@@ -3,7 +3,6 @@
#include "Resource.h"
#include "OcrImageAnalyzer.h"
#include "Controller.h"
#include "RecruitImageAnalyzer.h"
#include "ProcessTask.h"
#include "RecruitTask.h"
@@ -131,9 +130,16 @@ bool asst::AutoRecruitTask::calc_and_recruit()
return calc_and_recruit();
}
}
// 如果时间没调整过,那 tag 十有八九也没选,重新试一次
// 造成时间没调的原因可见: https://github.com/MaaAssistantArknights/MaaAssistantArknights/pull/300#issuecomment-1073287984
if (check_time_unreduced()) {
return calc_and_recruit();
}
if (need_exit()) {
return false;
}
if (std::find(m_confirm_level.cbegin(), m_confirm_level.cend(), maybe_level) != m_confirm_level.cend()) {
if (!confirm()) {
return false;
@@ -144,6 +150,12 @@ bool asst::AutoRecruitTask::calc_and_recruit()
}
return true;
}
bool asst::AutoRecruitTask::check_time_unreduced()
{
ProcessTask task(*this, {"RecruitCheckTimeUnreduced"});
task.set_retry_times(1);
return task.run();
}
bool asst::AutoRecruitTask::check_recruit_home_page()
{
@@ -168,4 +180,4 @@ bool asst::AutoRecruitTask::refresh()
{
ProcessTask refresh_task(*this, { "RecruitRefresh" });
return refresh_task.run();
}
}