refactor: StopGame (#9658)

* perf: StopGame

* style: rename Intent to packageName

* chore: 不准不选择区服

* fix: 移除其他配置中的抽象 stop 匹配

* style: 统一驼峰

* style: 按照执行顺序重新排序

* feat: 添加回调和文档

* fix: 修复参数传入

* docs: 更新文档

* fix: merge

* chore: 把WSA的配置也改了

* chore: update submodule

---------

Co-authored-by: uye <99072975+ABA2396@users.noreply.github.com>
Co-authored-by: Loong <wangl.cc@outlook.com>
This commit is contained in:
Rbqwow
2024-08-11 01:50:30 +08:00
committed by GitHub
parent f7ab391eff
commit d120a04206
23 changed files with 141 additions and 77 deletions

View File

@@ -244,17 +244,27 @@ bool asst::AdbController::start_game(const std::string& client_type)
if (client_type.empty()) {
return false;
}
auto intent_name = Config.get_intent_name(client_type);
if (!intent_name) {
auto package_name = Config.get_package_name(client_type);
if (!package_name) {
return false;
}
std::string cur_cmd = utils::string_replace_all(m_adb.start, "[Intent]", intent_name.value());
std::string cur_cmd =
utils::string_replace_all(m_adb.start, "[PackageName]", package_name.value());
return call_command(cur_cmd).has_value();
}
bool asst::AdbController::stop_game()
bool asst::AdbController::stop_game(const std::string& client_type)
{
return call_command(m_adb.stop).has_value();
if (client_type.empty()) {
return false;
}
auto package_name = Config.get_package_name(client_type);
if (!package_name) {
return false;
}
std::string cur_cmd =
utils::string_replace_all(m_adb.stop, "[PackageName]", package_name.value());
return call_command(cur_cmd).has_value();
}
bool asst::AdbController::click(const Point& p)