mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
feat: 支持 mumu 5555 端口使用控制台退出与截图增强
This commit is contained in:
@@ -211,7 +211,12 @@ int asst::AdbController::get_mumu_index(const std::string& address)
|
||||
return 0;
|
||||
}
|
||||
int port = std::stoi(port_str);
|
||||
int mumu_index = (port - 16384) / 32; // must be int
|
||||
int mumu_index = 0;
|
||||
if (port >= 16384) {
|
||||
mumu_index = (port - 16384) / 32;
|
||||
} else if (port >= 5555) {
|
||||
mumu_index = (port - 5555) / 2;
|
||||
}
|
||||
LogInfo << VAR(port_str) << VAR(port) << VAR(mumu_index);
|
||||
return mumu_index;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,18 @@ public class EmulatorHelper
|
||||
string portStr = address.Split(':')[1];
|
||||
if (int.TryParse(portStr, out int port))
|
||||
{
|
||||
emuIndex = (port - 16384) / 32;
|
||||
switch (port)
|
||||
{
|
||||
case >= 16384:
|
||||
emuIndex = (port - 16384) / 32;
|
||||
break;
|
||||
case >= 5555:
|
||||
emuIndex = (port - 5555) / 2;
|
||||
break;
|
||||
default:
|
||||
_logger.Error("Port {Port} is not valid for MuMuEmulator12", port);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user