feat(core): 初步完成六星公招通知
This commit is contained in:
@@ -466,7 +466,7 @@ class AppConfig:
|
|||||||
cur.close()
|
cur.close()
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
def save_maa_log(self, log_path: Path, logs: list, maa_result: str) -> None:
|
def save_maa_log(self, log_path: Path, logs: list, maa_result: str) -> bool:
|
||||||
"""保存MAA日志"""
|
"""保存MAA日志"""
|
||||||
|
|
||||||
data: Dict[str, Union[str, Dict[str, Union[int, dict]]]] = {
|
data: Dict[str, Union[str, Dict[str, Union[int, dict]]]] = {
|
||||||
@@ -475,6 +475,8 @@ class AppConfig:
|
|||||||
"maa_result": maa_result,
|
"maa_result": maa_result,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if_six_star = False
|
||||||
|
|
||||||
# 公招统计(仅统计招募到的)
|
# 公招统计(仅统计招募到的)
|
||||||
confirmed_recruit = False
|
confirmed_recruit = False
|
||||||
current_star_level = None
|
current_star_level = None
|
||||||
@@ -490,6 +492,8 @@ class AppConfig:
|
|||||||
star_match = re.search(r"(\d+)\s*★ Tags", logs[i])
|
star_match = re.search(r"(\d+)\s*★ Tags", logs[i])
|
||||||
if star_match:
|
if star_match:
|
||||||
current_star_level = f"{star_match.group(1)}★"
|
current_star_level = f"{star_match.group(1)}★"
|
||||||
|
if current_star_level == "6★":
|
||||||
|
if_six_star = True
|
||||||
|
|
||||||
if "已确认招募" in logs[i]: # 只有确认招募后才统计
|
if "已确认招募" in logs[i]: # 只有确认招募后才统计
|
||||||
confirmed_recruit = True
|
confirmed_recruit = True
|
||||||
@@ -553,6 +557,8 @@ class AppConfig:
|
|||||||
|
|
||||||
self.merge_maa_logs("所有项", log_path.parent)
|
self.merge_maa_logs("所有项", log_path.parent)
|
||||||
|
|
||||||
|
return if_six_star
|
||||||
|
|
||||||
def merge_maa_logs(self, mode: str, logs_path: Union[Path, List[Path]]) -> dict:
|
def merge_maa_logs(self, mode: str, logs_path: Union[Path, List[Path]]) -> dict:
|
||||||
"""合并指定数据统计信息文件"""
|
"""合并指定数据统计信息文件"""
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ class MaaManager(QObject):
|
|||||||
Config.silence_list.remove(self.emulator_path)
|
Config.silence_list.remove(self.emulator_path)
|
||||||
|
|
||||||
# 保存运行日志以及统计信息
|
# 保存运行日志以及统计信息
|
||||||
Config.save_maa_log(
|
if_six_star = Config.save_maa_log(
|
||||||
Config.app_path
|
Config.app_path
|
||||||
/ f"history/{curdate}/{self.data[user[2]][0]}/{start_time.strftime("%H-%M-%S")}.log",
|
/ f"history/{curdate}/{self.data[user[2]][0]}/{start_time.strftime("%H-%M-%S")}.log",
|
||||||
self.check_maa_log(start_time, mode_book[j]),
|
self.check_maa_log(start_time, mode_book[j]),
|
||||||
@@ -302,6 +302,14 @@ class MaaManager(QObject):
|
|||||||
/ f"history/{curdate}/{self.data[user[2]][0]}/{start_time.strftime("%H-%M-%S")}.json",
|
/ f"history/{curdate}/{self.data[user[2]][0]}/{start_time.strftime("%H-%M-%S")}.json",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if if_six_star:
|
||||||
|
|
||||||
|
self.push_notification(
|
||||||
|
"公招六星",
|
||||||
|
f"喜报:用户 {user[0]} 公招出六星啦!",
|
||||||
|
"好羡慕~",
|
||||||
|
)
|
||||||
|
|
||||||
# 成功完成代理的用户修改相关参数
|
# 成功完成代理的用户修改相关参数
|
||||||
if run_book[0] and run_book[1]:
|
if run_book[0] and run_book[1]:
|
||||||
if self.data[user[2]][14] == 0 and self.data[user[2]][3] != -1:
|
if self.data[user[2]][14] == 0 and self.data[user[2]][3] != -1:
|
||||||
@@ -1314,3 +1322,13 @@ class MaaManager(QObject):
|
|||||||
Notify.send_mail("网页", title, html_content)
|
Notify.send_mail("网页", title, html_content)
|
||||||
Notify.ServerChanPush(title, f"{message_text}\n\nAUTO_MAA 敬上")
|
Notify.ServerChanPush(title, f"{message_text}\n\nAUTO_MAA 敬上")
|
||||||
Notify.CompanyWebHookBotPush(title, f"{message_text}AUTO_MAA 敬上")
|
Notify.CompanyWebHookBotPush(title, f"{message_text}AUTO_MAA 敬上")
|
||||||
|
|
||||||
|
elif mode == "公招六星":
|
||||||
|
|
||||||
|
Notify.send_mail(
|
||||||
|
"文本",
|
||||||
|
title,
|
||||||
|
f"{message}\n\nAUTO_MAA 敬上\n\n我们根据您在 AUTO_MAA 中的设置发送了这封电子邮件,本邮件无需回复\n",
|
||||||
|
)
|
||||||
|
Notify.ServerChanPush(title, f"{message}\n\nAUTO_MAA 敬上")
|
||||||
|
Notify.CompanyWebHookBotPush(title, f"{message}AUTO_MAA 敬上")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"main_version": "4.2.4.7",
|
"main_version": "4.2.4.7",
|
||||||
"updater_version": "1.1.2.1",
|
"updater_version": "1.1.2.1",
|
||||||
"announcement": "\n## 新增功能\n- 历史记录统计功能上线\n- 添加软件主页\n- 添加启动时直接最小化功能\n- 更新器拥有多网址测速功能\n- 添加统计信息通知功能\n## 修复BUG\n- RMA70-12不能正确统计的问题\n- 更新器修正`channel`\n## 程序优化\n- 添加MAA监测字段:`未检测到任何模拟器`\n- 取消MAA运行中自动更新",
|
"announcement": "\n## 新增功能\n- 历史记录统计功能上线\n- 添加软件主页\n- 添加启动时直接最小化功能\n- 更新器拥有多网址测速功能\n- 添加统计信息通知功能(含六星监测)\n## 修复BUG\n- RMA70-12不能正确统计的问题\n- 更新器修正`channel`\n## 程序优化\n- 添加MAA监测字段:`未检测到任何模拟器`\n- 取消MAA运行中自动更新",
|
||||||
"proxy_list": [
|
"proxy_list": [
|
||||||
"",
|
"",
|
||||||
"https://gitproxy.click/",
|
"https://gitproxy.click/",
|
||||||
|
|||||||
Reference in New Issue
Block a user