mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 02:55:38 +08:00
fix: 修复开多个模拟器时地址判断逻辑错误
This commit is contained in:
@@ -1221,26 +1221,23 @@ namespace MaaWpfGui.Main
|
||||
IfPortEstablished(Instances.SettingsViewModel.ConnectAddress);
|
||||
bool bsResult = IfPortEstablished(bsHvAddress);
|
||||
|
||||
// 枚举所有情况
|
||||
if (adbResult && bsResult)
|
||||
if (adbResult)
|
||||
{
|
||||
// 2 connections(s)
|
||||
error = LocalizationHelper.GetString("EmulatorTooMany");
|
||||
return false;
|
||||
error = string.Empty;
|
||||
}
|
||||
else if (adbResult || bsResult)
|
||||
else if (bsResult)
|
||||
{
|
||||
// 1 connections(s)
|
||||
Instances.SettingsViewModel.ConnectAddress = adbResult ? Instances.SettingsViewModel.ConnectAddress : bsHvAddress;
|
||||
Instances.SettingsViewModel.ConnectAddress = bsHvAddress;
|
||||
error = string.Empty;
|
||||
}
|
||||
else if (adbConfResult)
|
||||
{
|
||||
// 用户填了这个,虽然端口没检测到,但是凑合用吧
|
||||
error = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 0 connections(s)
|
||||
if (!adbConfResult)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user