无命令行中止MAA进程

This commit is contained in:
DLmaster
2024-10-26 15:31:49 +08:00
parent 85bccea2dd
commit af24208cf3
2 changed files with 19 additions and 3 deletions

View File

@@ -220,7 +220,12 @@ class MaaRunner(QtCore.QThread):
"\n".join([self.data[_][0] for _ in error_index]),
result,
)
os.system("taskkill /F /T /PID " + str(maa.pid))
killprocess = subprocess.Popen(
"taskkill /F /T /PID " + str(maa.pid),
shell=True,
creationflags=subprocess.CREATE_NO_WINDOW,
)
killprocess.wait()
self.push_notification.emit(
"用户日常代理出现异常!",
"用户 "
@@ -322,7 +327,12 @@ class MaaRunner(QtCore.QThread):
"\n".join([self.data[_][0] for _ in error_index]),
result,
)
os.system("taskkill /F /T /PID " + str(maa.pid))
killprocess = subprocess.Popen(
"taskkill /F /T /PID " + str(maa.pid),
shell=True,
creationflags=subprocess.CREATE_NO_WINDOW,
)
killprocess.wait()
if_strat_app = True
if self.if_run:
time.sleep(10)
@@ -387,7 +397,12 @@ class MaaRunner(QtCore.QThread):
if self.mode in ["日常代理", "人工排查"]:
# 关闭可能未正常退出的MAA进程
if not self.if_run:
os.system("taskkill /F /T /PID " + str(maa.pid))
killprocess = subprocess.Popen(
"taskkill /F /T /PID " + str(maa.pid),
shell=True,
creationflags=subprocess.CREATE_NO_WINDOW,
)
killprocess.wait()
# 更新用户数据
modes = [self.data[_][15] for _ in all_index]
uids = [self.data[_][16] for _ in all_index]

View File

@@ -7,6 +7,7 @@ v4.0_beta
## 程序优化
- 进一步优化MAA配置流程
- 优化自定义基建配置方法 #7
- 无命令行窗口中止MAA进程
- `gameid.txt`改由主程序进行初始化
- log获取部分集成为1个函数
- 消除部分if嵌套