From 06540b762f69dc440679109c79b69797302cceb5 Mon Sep 17 00:00:00 2001 From: Horror Proton <107091537+horror-proton@users.noreply.github.com> Date: Mon, 23 Jan 2023 01:10:16 +0800 Subject: [PATCH] fix: allow connecting to different address in `call_command_tcpip` fix https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/3441 --- src/MaaCore/Controller.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/MaaCore/Controller.cpp b/src/MaaCore/Controller.cpp index aeaa403382..0233968673 100644 --- a/src/MaaCore/Controller.cpp +++ b/src/MaaCore/Controller.cpp @@ -1680,9 +1680,8 @@ std::optional asst::Controller::call_command_tcpip(const std::string& cmd, // adb connect // TODO: adb server 尚未实现,第一次连接需要执行一次 adb.exe 启动 daemon if (std::regex_match(cmd, match, connect_regex)) { - if (!m_adb_client) { - m_adb_client = adb::client::create(match[1].str()); - } + + m_adb_client = adb::client::create(match[1].str()); // TODO: compare address with existing (if any) try { pipe_data = m_adb_client->connect();