From 78632aa14bdcc0353be0a2ffe2b5cac85352299f Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 10 Sep 2023 13:08:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dgui=20=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E5=88=86=E5=89=B2=E8=B6=8A=E7=95=8C=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #6290 --- src/MaaWpfGui/Main/AsstProxy.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/MaaWpfGui/Main/AsstProxy.cs b/src/MaaWpfGui/Main/AsstProxy.cs index 79c3df29da..7efd94f7ce 100644 --- a/src/MaaWpfGui/Main/AsstProxy.cs +++ b/src/MaaWpfGui/Main/AsstProxy.cs @@ -1108,6 +1108,7 @@ namespace MaaWpfGui.Main case "StageQueueUnableToAgent": Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("StageQueue") + $" {subTaskDetails["stage_code"]} " + LocalizationHelper.GetString("UnableToAgent"), UiLogColor.Info); break; + case "StageQueueMissionCompleted": Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("StageQueue") + $" {subTaskDetails["stage_code"]} - {subTaskDetails["stars"]} ★", UiLogColor.Info); break; @@ -1149,7 +1150,6 @@ namespace MaaWpfGui.Main private static readonly bool ForcedReloadResource = File.Exists("DEBUG") || File.Exists("DEBUG.txt"); - /// /// 检查端口是否有效。 /// @@ -1165,6 +1165,11 @@ namespace MaaWpfGui.Main // normal -> [host]:[port] // LDPlayer -> emulator-[port] string[] address_ = address.Contains(":") ? address.Split(':') : address.Split('-'); + if (address_.Length != 2) + { + return false; + } + string host = address_[0].Equals("emulator") ? "127.0.0.1" : address_[0]; int port = int.Parse(address_[1]);