fix: allow connecting to different address in call_command_tcpip

fix https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/3441
This commit is contained in:
Horror Proton
2023-01-23 01:10:16 +08:00
parent e8f8891bb1
commit 06540b762f

View File

@@ -1680,9 +1680,8 @@ std::optional<int> 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();