From a9d661c5403d97dd54b7ce893ea8b6c02e32e795 Mon Sep 17 00:00:00 2001 From: status102 Date: Mon, 11 Dec 2023 11:07:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E6=9C=80=E5=BF=AB=E6=96=B9=E5=BC=8F=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E4=B8=8D=E6=88=90=E5=8A=9F=E6=97=B6=EF=BC=8C=E4=B8=8D=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Controller/AdbController.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/MaaCore/Controller/AdbController.cpp b/src/MaaCore/Controller/AdbController.cpp index 8bc45666ce..716710536d 100644 --- a/src/MaaCore/Controller/AdbController.cpp +++ b/src/MaaCore/Controller/AdbController.cpp @@ -427,16 +427,18 @@ bool asst::AdbController::screencap(cv::Mat& image_payload, bool allow_reconnect { AdbProperty::ScreencapMethod::Encode, "Encode" }, }; Log.info("The fastest way is", MethodName.at(m_adb.screencap_method), ", cost:", min_cost.count(), "ms"); - json::value info = json::object { - { "uuid", m_uuid }, - { "what", "FastestWayToScreencap" }, - { "details", - json::object { - { "method", MethodName.at(m_adb.screencap_method) }, - { "cost", min_cost.count() }, - } }, - }; - callback(AsstMsg::ConnectionInfo, info); + if (m_adb.screencap_method != AdbProperty::ScreencapMethod::UnknownYet) { + json::value info = json::object { + { "uuid", m_uuid }, + { "what", "FastestWayToScreencap" }, + { "details", + json::object { + { "method", MethodName.at(m_adb.screencap_method) }, + { "cost", min_cost.count() }, + } }, + }; + callback(AsstMsg::ConnectionInfo, info); + } clear_lf_info(); return m_adb.screencap_method != AdbProperty::ScreencapMethod::UnknownYet; } break;