mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 18:20:39 +08:00
Merge branch 'dev' into docs/doc
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
0
|
||||
],
|
||||
"controlDelayRange_Doc": "点击随机延时:每次点击操作会进行随机延时,降低封号风险(好像也没听说过谁被封号的)。格式为 [ 最小延时, 最大延时 ],单位为毫秒。例如想设置3~5秒延时,即修改为[ 3000, 5000 ],默认0~0",
|
||||
"adbExtraSwipeDist": 50,
|
||||
"adbExtraSwipeDist": 100,
|
||||
"adbExtraSwipeDist_Doc": "额外的滑动距离:adb有bug,同样的参数,偶尔会划得非常远。额外做一个短程滑动,把之前的停下来",
|
||||
"adbExtraSwipeDuration": 1000,
|
||||
"adbExtraSwipeDuration_Doc": "额外的滑动持续时间:adb有bug,同样的参数,偶尔会划得非常远。额外做一个短程滑动,把之前的停下来。若小于0,则关闭额外滑动功能",
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
[
|
||||
{
|
||||
"name": "金酒之杯",
|
||||
"no_longer_buy": true,
|
||||
"ignore_no_longer_buy": true
|
||||
"name": "扩散之手",
|
||||
"chars": [
|
||||
"异客"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "投币玩具",
|
||||
"name": "撕扯之手",
|
||||
"chars": [
|
||||
"帕拉斯"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "金酒之杯",
|
||||
"no_longer_buy": true,
|
||||
"ignore_no_longer_buy": true
|
||||
},
|
||||
@@ -14,16 +21,19 @@
|
||||
"no_longer_buy": true,
|
||||
"ignore_no_longer_buy": true
|
||||
},
|
||||
{
|
||||
"name": "投币玩具",
|
||||
"no_longer_buy": true,
|
||||
"ignore_no_longer_buy": true
|
||||
},
|
||||
{
|
||||
"name": "人事部密信"
|
||||
},
|
||||
{
|
||||
"name": "Miss.Christine摸摸券",
|
||||
"promotion": 2
|
||||
},
|
||||
{
|
||||
"name": "残弩-典训",
|
||||
"role": "SNIPER",
|
||||
"roles": [
|
||||
"SNIPER"
|
||||
],
|
||||
"promotion": 1
|
||||
},
|
||||
{
|
||||
@@ -33,380 +43,436 @@
|
||||
"name": "073号安全试剂"
|
||||
},
|
||||
{
|
||||
"name": "《第二经济改革法》"
|
||||
"name": "Miss.Christine摸摸券",
|
||||
"promotion": 2
|
||||
},
|
||||
{
|
||||
"name": "残弩-神速",
|
||||
"roles": [
|
||||
"SNIPER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "折戟-浴血",
|
||||
"role": "WARRIOR"
|
||||
"roles": [
|
||||
"WARRIOR"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "四叶草化石"
|
||||
},
|
||||
{
|
||||
"name": "长生者之证"
|
||||
"name": "玻璃小鸟"
|
||||
},
|
||||
{
|
||||
"name": "残弩-神速",
|
||||
"role": "SNIPER"
|
||||
"name": "赤金的远征"
|
||||
},
|
||||
{
|
||||
"name": "锈蚀的铁锤"
|
||||
},
|
||||
{
|
||||
"name": "《第二经济改革法》"
|
||||
},
|
||||
{
|
||||
"name": "长生者之证"
|
||||
},
|
||||
{
|
||||
"name": "被撬开的道具箱"
|
||||
},
|
||||
{
|
||||
"name": "石像鬼塑像"
|
||||
},
|
||||
{
|
||||
"name": "尖笑鬼牌",
|
||||
"promotion": 1
|
||||
},
|
||||
{
|
||||
"name": "赤金的远征"
|
||||
},
|
||||
{
|
||||
"name": "玻璃小鸟"
|
||||
"name": "血魔的寝床"
|
||||
},
|
||||
{
|
||||
"name": "《杜林地上环游记》"
|
||||
},
|
||||
{
|
||||
"name": "高卢银行支票"
|
||||
},
|
||||
{
|
||||
"name": "血魔的寝床"
|
||||
},
|
||||
{
|
||||
"name": "石像鬼塑像"
|
||||
},
|
||||
{
|
||||
"name": "被撬开的道具箱"
|
||||
},
|
||||
{
|
||||
"name": "折戟-典训",
|
||||
"role": "WARRIOR",
|
||||
"promotion": 1
|
||||
},
|
||||
{
|
||||
"name": "全局作战文件"
|
||||
},
|
||||
{
|
||||
"name": "特殊抑制器"
|
||||
},
|
||||
{
|
||||
"name": "折戟-一夫当关",
|
||||
"role": "WARRIOR"
|
||||
},
|
||||
{
|
||||
"name": "“时光之末”"
|
||||
},
|
||||
{
|
||||
"name": "钝爪-典训",
|
||||
"role": "PIONEER",
|
||||
"name": "折戟-典训",
|
||||
"roles": [
|
||||
"WARRIOR"
|
||||
],
|
||||
"promotion": 1
|
||||
},
|
||||
{
|
||||
"name": "高卢银行支票"
|
||||
},
|
||||
{
|
||||
"name": "折戟-破釜沉舟",
|
||||
"roles": [
|
||||
"WARRIOR"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "折戟-一夫当关",
|
||||
"roles": [
|
||||
"WARRIOR"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "全局作战文件"
|
||||
},
|
||||
{
|
||||
"name": "折戟-锋刃",
|
||||
"roles": [
|
||||
"WARRIOR"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "皇家利口酒"
|
||||
},
|
||||
{
|
||||
"name": "折戟-锋刃",
|
||||
"role": "WARRIOR"
|
||||
},
|
||||
{
|
||||
"name": "苦行者泡芙"
|
||||
"name": "断杖-典训",
|
||||
"roles": [
|
||||
"CASTER"
|
||||
],
|
||||
"promotion": 1
|
||||
},
|
||||
{
|
||||
"name": "古旧乐谱残章"
|
||||
},
|
||||
{
|
||||
"name": "断杖-典训",
|
||||
"role": "CASTER",
|
||||
"promotion": 1
|
||||
},
|
||||
{
|
||||
"name": "高卢小圆饼"
|
||||
},
|
||||
{
|
||||
"name": "老蒲扇"
|
||||
},
|
||||
{
|
||||
"name": "蓝色丝巾"
|
||||
},
|
||||
{
|
||||
"name": "微缩舞台模型"
|
||||
"name": "苦行者泡芙"
|
||||
},
|
||||
{
|
||||
"name": "乌萨斯列巴"
|
||||
},
|
||||
{
|
||||
"name": "万能钥匙"
|
||||
"name": "高卢小圆饼"
|
||||
},
|
||||
{
|
||||
"name": "折戟-破釜沉舟",
|
||||
"role": "WARRIOR"
|
||||
"name": "微缩舞台模型"
|
||||
},
|
||||
{
|
||||
"name": "难闻的止血剂"
|
||||
"name": "蓝色丝巾"
|
||||
},
|
||||
{
|
||||
"name": "猩红剧团票根"
|
||||
},
|
||||
{
|
||||
"name": "源石鸢尾花"
|
||||
},
|
||||
{
|
||||
"name": "女妖之吻"
|
||||
},
|
||||
{
|
||||
"name": "突击协议-利刃"
|
||||
},
|
||||
{
|
||||
"name": "折戟-突破",
|
||||
"role": "WARRIOR"
|
||||
},
|
||||
{
|
||||
"name": "“当红歌手”"
|
||||
"name": "钝爪-典训",
|
||||
"roles": [
|
||||
"PIONEER"
|
||||
],
|
||||
"promotion": 1
|
||||
},
|
||||
{
|
||||
"name": "残弩-百步穿杨",
|
||||
"role": "SNIPER"
|
||||
"roles": [
|
||||
"SNIPER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "爱丽舍钱袋"
|
||||
},
|
||||
{
|
||||
"name": "迷迭香之拥"
|
||||
},
|
||||
{
|
||||
"name": "莱塔尼亚荣誉勋章"
|
||||
},
|
||||
{
|
||||
"name": "空白名片"
|
||||
},
|
||||
{
|
||||
"name": "银餐叉"
|
||||
},
|
||||
{
|
||||
"name": "断杖-织法者",
|
||||
"role": "CASTER"
|
||||
"name": "万能钥匙"
|
||||
},
|
||||
{
|
||||
"name": "“法术杀手”"
|
||||
},
|
||||
{
|
||||
"name": "红色蝴蝶结"
|
||||
"name": "猩红剧团票根"
|
||||
},
|
||||
{
|
||||
"name": "“黑夜呢喃”"
|
||||
"name": "老蒲扇"
|
||||
},
|
||||
{
|
||||
"name": "悬丝傀儡"
|
||||
"name": "空白名片"
|
||||
},
|
||||
{
|
||||
"name": "断杖-咏唱",
|
||||
"role": "CASTER"
|
||||
"name": "难闻的止血剂"
|
||||
},
|
||||
{
|
||||
"name": "苍白花冠"
|
||||
"name": "迷迭香之拥"
|
||||
},
|
||||
{
|
||||
"name": "源石鸢尾花"
|
||||
},
|
||||
{
|
||||
"name": "断杖-织法者",
|
||||
"roles": [
|
||||
"CASTER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "“当红歌手”"
|
||||
},
|
||||
{
|
||||
"name": "银餐叉"
|
||||
},
|
||||
{
|
||||
"name": "Scout的狙击镜"
|
||||
},
|
||||
{
|
||||
"name": "制式防暴用具"
|
||||
"name": "维多利亚“废铁”勋章"
|
||||
},
|
||||
{
|
||||
"name": "维多利亚蛋糕"
|
||||
"name": "折戟-突破",
|
||||
"roles": [
|
||||
"WARRIOR"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "钝爪-爆发",
|
||||
"role": "PIONEER"
|
||||
"name": "莱塔尼亚荣誉勋章"
|
||||
},
|
||||
{
|
||||
"name": "支柱-典训",
|
||||
"role": "SUPPORT",
|
||||
"promotion": 1
|
||||
"name": "女妖之吻"
|
||||
},
|
||||
{
|
||||
"name": "皇帝的收藏"
|
||||
"name": "突击协议-利刃",
|
||||
"roles": [
|
||||
"WARRIOR",
|
||||
"PIONEER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "作者的喉舌"
|
||||
},
|
||||
{
|
||||
"name": "香草沙士汽水"
|
||||
},
|
||||
{
|
||||
"name": "幸运硬币",
|
||||
"ignore_no_longer_buy": true
|
||||
},
|
||||
{
|
||||
"name": "镶金骨骰"
|
||||
},
|
||||
{
|
||||
"name": "古高卢银币"
|
||||
},
|
||||
{
|
||||
"name": "赶车夫的长鞭"
|
||||
},
|
||||
{
|
||||
"name": "迷梦香精"
|
||||
},
|
||||
{
|
||||
"name": "钝爪-百战",
|
||||
"role": "PIONEER"
|
||||
"name": "爱丽舍钱袋"
|
||||
},
|
||||
{
|
||||
"name": "至宝指环",
|
||||
"ignore_no_longer_buy": true
|
||||
},
|
||||
{
|
||||
"name": "制式防暴用具"
|
||||
},
|
||||
{
|
||||
"name": "幸运硬币",
|
||||
"ignore_no_longer_buy": true
|
||||
},
|
||||
{
|
||||
"name": "维多利亚蛋糕"
|
||||
},
|
||||
{
|
||||
"name": "“黑夜呢喃”"
|
||||
},
|
||||
{
|
||||
"name": "红色蝴蝶结"
|
||||
},
|
||||
{
|
||||
"name": "残弩-战场依存",
|
||||
"role": "SNIPER"
|
||||
"roles": [
|
||||
"SNIPER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "贵族刺剑"
|
||||
"name": "断杖-咏唱",
|
||||
"roles": [
|
||||
"CASTER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "人偶之家"
|
||||
"name": "支柱-典训",
|
||||
"roles": [
|
||||
"SUPPORT"
|
||||
],
|
||||
"promotion": 1
|
||||
},
|
||||
{
|
||||
"name": "《旧高卢地名源流考》"
|
||||
"name": "香草沙士汽水"
|
||||
},
|
||||
{
|
||||
"name": "医者-妙手",
|
||||
"role": "MEDIC"
|
||||
"name": "悬丝傀儡"
|
||||
},
|
||||
{
|
||||
"name": "设计师量尺"
|
||||
"name": "镶金骨骰"
|
||||
},
|
||||
{
|
||||
"name": "钝爪-爆发",
|
||||
"roles": [
|
||||
"PIONEER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "苍白花冠"
|
||||
},
|
||||
{
|
||||
"name": "“绽放”"
|
||||
},
|
||||
{
|
||||
"name": "锈蚀刀片"
|
||||
"name": "作者的喉舌"
|
||||
},
|
||||
{
|
||||
"name": "破坏协议-消除"
|
||||
"name": "设计师量尺"
|
||||
},
|
||||
{
|
||||
"name": "古高卢银币"
|
||||
},
|
||||
{
|
||||
"name": "医者-妙手",
|
||||
"roles": [
|
||||
"MEDIC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "急救药箱"
|
||||
},
|
||||
{
|
||||
"name": "钝爪-百战",
|
||||
"roles": [
|
||||
"PIONEER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "皇帝的收藏"
|
||||
},
|
||||
{
|
||||
"name": "断杖-凝神",
|
||||
"role": "CASTER"
|
||||
"roles": [
|
||||
"CASTER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "铁棍面包"
|
||||
},
|
||||
{
|
||||
"name": "摩根队长佳酿"
|
||||
"name": "迷梦香精"
|
||||
},
|
||||
{
|
||||
"name": "破坏协议-消除"
|
||||
"name": "赶车夫的长鞭"
|
||||
},
|
||||
{
|
||||
"name": "“噤声”"
|
||||
"name": "人偶之家"
|
||||
},
|
||||
{
|
||||
"name": "远程协议-遥击"
|
||||
"name": "锈蚀刀片"
|
||||
},
|
||||
{
|
||||
"name": "“童趣玩偶”"
|
||||
"name": "贵族刺剑"
|
||||
},
|
||||
{
|
||||
"name": "试制巧克力"
|
||||
},
|
||||
{
|
||||
"name": "远程协议-遥击"
|
||||
},
|
||||
{
|
||||
"name": "羽兽肝酱"
|
||||
},
|
||||
{
|
||||
"name": "地区行动方案"
|
||||
},
|
||||
{
|
||||
"name": "显圣吊坠"
|
||||
},
|
||||
{
|
||||
"name": "安洁莉娜的创想"
|
||||
"name": "《旧高卢地名源流考》"
|
||||
},
|
||||
{
|
||||
"name": "路线说明图"
|
||||
},
|
||||
{
|
||||
"name": "医者-理智固剂",
|
||||
"role": "MEDIC"
|
||||
"name": "摩根队长佳酿"
|
||||
},
|
||||
{
|
||||
"name": "钝爪-熟稔",
|
||||
"role": "PIONEER"
|
||||
},
|
||||
{
|
||||
"name": "古怪的长笛"
|
||||
"name": "试制巧克力"
|
||||
},
|
||||
{
|
||||
"name": "黄铜指南针"
|
||||
},
|
||||
{
|
||||
"name": "“聚焦”"
|
||||
"name": "“噤声”"
|
||||
},
|
||||
{
|
||||
"name": "皇族金胸针"
|
||||
"name": "“童趣玩偶”"
|
||||
},
|
||||
{
|
||||
"name": "活玫瑰"
|
||||
"name": "显圣吊坠"
|
||||
},
|
||||
{
|
||||
"name": "独奏八音盒"
|
||||
"name": "破坏协议-消除",
|
||||
"roles": [
|
||||
"CASTER",
|
||||
"SPECIAL"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "破损的面具"
|
||||
"name": "远程协议-遥击",
|
||||
"roles": [
|
||||
"SNIPER",
|
||||
"MEDIC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "开裂的束缚带"
|
||||
},
|
||||
{
|
||||
"name": "生命之水"
|
||||
"name": "地区行动方案"
|
||||
},
|
||||
{
|
||||
"name": "舞者手链"
|
||||
},
|
||||
{
|
||||
"name": "安洁莉娜的创想"
|
||||
},
|
||||
{
|
||||
"name": "异铁小圆盾"
|
||||
},
|
||||
{
|
||||
"name": "破损的面具"
|
||||
},
|
||||
{
|
||||
"name": "羽兽肝酱"
|
||||
},
|
||||
{
|
||||
"name": "活玫瑰"
|
||||
},
|
||||
{
|
||||
"name": "“聚焦”"
|
||||
},
|
||||
{
|
||||
"name": "钝爪-熟稔",
|
||||
"roles": [
|
||||
"PIONEER"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "独奏八音盒"
|
||||
},
|
||||
{
|
||||
"name": "球球果汁"
|
||||
},
|
||||
{
|
||||
"name": "残破合影"
|
||||
"name": "古怪的长笛"
|
||||
},
|
||||
{
|
||||
"name": "女皇之愿"
|
||||
},
|
||||
{
|
||||
"name": "军团护心镜"
|
||||
},
|
||||
{
|
||||
"name": "精神治疗录像带"
|
||||
},
|
||||
{
|
||||
"name": "解约协议"
|
||||
},
|
||||
{
|
||||
"name": "皇帝的恩宠"
|
||||
},
|
||||
{
|
||||
"name": "食腐者手杖"
|
||||
},
|
||||
{
|
||||
"name": "荒地龙舌兰"
|
||||
},
|
||||
{
|
||||
"name": "“迷醉荷谟伊”"
|
||||
},
|
||||
{
|
||||
"name": "演出用香水"
|
||||
},
|
||||
{
|
||||
"name": "医者-理智固剂",
|
||||
"roles": [
|
||||
"MEDIC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "生命之水"
|
||||
},
|
||||
{
|
||||
"name": "奇渊面具"
|
||||
},
|
||||
{
|
||||
"name": "昏暗的提灯"
|
||||
},
|
||||
{
|
||||
"name": "皇族金胸针"
|
||||
},
|
||||
{
|
||||
"name": "皇帝的恩宠"
|
||||
},
|
||||
{
|
||||
"name": "开裂的束缚带"
|
||||
},
|
||||
{
|
||||
"name": "解约协议"
|
||||
},
|
||||
{
|
||||
"name": "残破合影"
|
||||
},
|
||||
{
|
||||
"name": "精神治疗录像带"
|
||||
},
|
||||
{
|
||||
"name": "军团护心镜"
|
||||
},
|
||||
{
|
||||
"name": "“迷醉荷谟伊”"
|
||||
},
|
||||
{
|
||||
"name": "食腐者手杖"
|
||||
},
|
||||
{
|
||||
"name": "凯旋号角"
|
||||
},
|
||||
@@ -414,16 +480,10 @@
|
||||
"name": "假面舞会面具",
|
||||
"ignore_no_longer_buy": true
|
||||
},
|
||||
{
|
||||
"name": "奇渊面具"
|
||||
},
|
||||
{
|
||||
"name": "“逝者垂泪”"
|
||||
},
|
||||
{
|
||||
"name": "高闪相机"
|
||||
},
|
||||
{
|
||||
"name": "维多利亚“废铁”勋章"
|
||||
"name": "“逝者垂泪”"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace asst::infrast
|
||||
std::vector<std::string> names; // 很多基建技能是一样的,就是名字不同。所以一个技能id可能对应多个名字
|
||||
std::string desc;
|
||||
std::unordered_map<std::string, double> efficient; // 技能效率,key:产品名(赤金、经验书等), value: 效率数值
|
||||
std::unordered_map<std::string, std::string> efficient_regex; // 技能效率正则,key:产品名(赤金、经验书等), value: 效率正则。如不为空,会先对正则进行计算,再加上efficient里面的值
|
||||
int max_num = INT_MAX; // 最多选几个该技能
|
||||
std::unordered_map<std::string, std::string> efficient_regex; // 技能效率正则,key:产品名(赤金、经验书等), value: 效率正则。如不为空,会先对正则进行计算,再加上efficient里面的值
|
||||
int max_num = INT_MAX; // 最多选几个该技能
|
||||
|
||||
bool operator==(const Skill& skill) const noexcept
|
||||
{
|
||||
@@ -66,7 +66,7 @@ namespace asst::infrast
|
||||
{
|
||||
struct Oper
|
||||
{
|
||||
std::string face_hash; // 有些干员的技能是完全一样的,做个hash区分一下不同干员
|
||||
std::string face_hash; // 有些干员的技能是完全一样的,做个hash区分一下不同干员
|
||||
Smiley smiley;
|
||||
double mood_ratio = 0; // 心情进度条的百分比
|
||||
Doing doing = Doing::Invalid;
|
||||
@@ -113,7 +113,7 @@ namespace asst::infrast
|
||||
std::unordered_map<std::string, int> conditions; // 技能组合可用条件,例如:key 发电站数量,value 3
|
||||
std::vector<SkillsComb> necessary; // 必选技能。这里面的缺少任一,则该技能组合不可用
|
||||
std::vector<SkillsComb> optional; // 可选技能。
|
||||
bool allow_external = false; // 当干员数没满3个的时候,是否允许补充外部干员
|
||||
bool allow_external = false; // 当干员数没满3个的时候,是否允许补充外部干员
|
||||
};
|
||||
|
||||
enum class WorkMode
|
||||
|
||||
@@ -139,6 +139,9 @@ friend Point& operator Op##= (Point& val, const Point& opd) noexcept { val.x Op#
|
||||
~TextRect() = default;
|
||||
TextRect(const TextRect&) = default;
|
||||
TextRect(TextRect&&) noexcept = default;
|
||||
explicit TextRect(double score, const Rect& rect, const std::string& text)
|
||||
: score(score), rect(rect), text(text)
|
||||
{}
|
||||
|
||||
explicit operator std::string() const noexcept { return text; }
|
||||
explicit operator Rect() const noexcept { return rect; }
|
||||
@@ -178,6 +181,9 @@ friend Point& operator Op##= (Point& val, const Point& opd) noexcept { val.x Op#
|
||||
~MatchRect() = default;
|
||||
MatchRect(const MatchRect&) = default;
|
||||
MatchRect(MatchRect&&) noexcept = default;
|
||||
explicit MatchRect(double score, const Rect& rect)
|
||||
: score(score), rect(rect)
|
||||
{}
|
||||
|
||||
explicit operator Rect() const noexcept { return rect; }
|
||||
MatchRect& operator=(const MatchRect&) = default;
|
||||
@@ -244,8 +250,8 @@ namespace asst
|
||||
TaskInfo(TaskInfo&&) noexcept = default;
|
||||
TaskInfo& operator=(const TaskInfo&) = default;
|
||||
TaskInfo& operator=(TaskInfo&&) noexcept = default;
|
||||
std::string name; // 任务名
|
||||
AlgorithmType algorithm = // 图像算法类型
|
||||
std::string name; // 任务名
|
||||
AlgorithmType algorithm = // 图像算法类型
|
||||
AlgorithmType::Invalid;
|
||||
ProcessTaskAction action = // 要进行的操作
|
||||
ProcessTaskAction::Invalid;
|
||||
@@ -256,7 +262,7 @@ namespace asst
|
||||
std::vector<std::string> exceeded_next; // 达到最多次数了之后,下一个可能的任务(列表)
|
||||
std::vector<std::string> on_error_next; // 任务出错之后要去执行什么
|
||||
std::vector<std::string> reduce_other_times; // 执行了该任务后,需要减少别的任务的执行次数。例如执行了吃理智药,则说明上一次点击蓝色开始行动按钮没生效,所以蓝色开始行动要-1
|
||||
Rect specific_rect; // 指定区域,目前仅针对ClickRect任务有用,会点这个区域
|
||||
Rect specific_rect; // 指定区域,目前仅针对ClickRect任务有用,会点这个区域
|
||||
int pre_delay = 0; // 执行该任务前的延时
|
||||
int rear_delay = 0; // 执行该任务后的延时
|
||||
int retry_times = INT_MAX; // 未找到图像时的重试次数
|
||||
@@ -304,7 +310,7 @@ namespace asst
|
||||
HashTaskInfo(HashTaskInfo&&) noexcept = default;
|
||||
HashTaskInfo& operator=(const HashTaskInfo&) = default;
|
||||
HashTaskInfo& operator=(HashTaskInfo&&) noexcept = default;
|
||||
std::vector<std::string> hashes; // 需要多个哈希值
|
||||
std::vector<std::string> hashes; // 需要多个哈希值
|
||||
int dist_threshold = 0; // 汉明距离阈值
|
||||
std::pair<int, int> mask_range; // 掩码的二值化范围
|
||||
bool bound = false; // 是否裁剪周围黑边
|
||||
|
||||
@@ -6,24 +6,34 @@ bool asst::RoguelikeShoppingConfiger::parse(const json::value& json)
|
||||
{
|
||||
for (const auto& goods_json : json.as_array()) {
|
||||
std::string name = goods_json.at("name").as_string();
|
||||
static const std::unordered_map<std::string, BattleRole> RoleMap = {
|
||||
{ "CASTER", BattleRole::Caster },
|
||||
{ "MEDIC", BattleRole::Medic },
|
||||
{ "PIONEER", BattleRole::Pioneer },
|
||||
{ "SNIPER", BattleRole::Sniper},
|
||||
{ "SPECIAL", BattleRole::Special},
|
||||
{ "SUPPORT", BattleRole::Support},
|
||||
{ "TANK", BattleRole::Tank},
|
||||
{ "WARRIOR", BattleRole::Warrior},
|
||||
};
|
||||
BattleRole role = BattleRole::Unknown;
|
||||
std::string str_role = goods_json.get("role", "");
|
||||
if (!str_role.empty()) {
|
||||
role = RoleMap.at(str_role);
|
||||
|
||||
std::vector<BattleRole> roles;
|
||||
if (auto roles_opt = goods_json.find<json::array>("roles")) {
|
||||
for (const auto& role_json : roles_opt.value()) {
|
||||
static const std::unordered_map<std::string, BattleRole> RoleMap = {
|
||||
{ "CASTER", BattleRole::Caster },
|
||||
{ "MEDIC", BattleRole::Medic },
|
||||
{ "PIONEER", BattleRole::Pioneer },
|
||||
{ "SNIPER", BattleRole::Sniper},
|
||||
{ "SPECIAL", BattleRole::Special},
|
||||
{ "SUPPORT", BattleRole::Support},
|
||||
{ "TANK", BattleRole::Tank},
|
||||
{ "WARRIOR", BattleRole::Warrior},
|
||||
};
|
||||
roles.emplace_back(RoleMap.at(role_json.as_string()));
|
||||
}
|
||||
}
|
||||
std::vector<std::string> chars;
|
||||
if (auto chars_opt = goods_json.find<json::array>("chars")) {
|
||||
for (const auto& char_json : chars_opt.value()) {
|
||||
chars.emplace_back(char_json.as_string());
|
||||
}
|
||||
}
|
||||
|
||||
RoguelikeGoods goods;
|
||||
goods.name = std::move(name);
|
||||
goods.role_restriction = role;
|
||||
goods.roles = std::move(roles);
|
||||
goods.chars = std::move(chars);
|
||||
goods.promotion = goods_json.get("promotion", 0);
|
||||
goods.no_longer_buy = goods_json.get("no_longer_buy", false);
|
||||
goods.ignore_no_longer_buy = goods_json.get("ignore_no_longer_buy", false);
|
||||
|
||||
@@ -11,7 +11,8 @@ namespace asst
|
||||
struct RoguelikeGoods
|
||||
{
|
||||
std::string name;
|
||||
BattleRole role_restriction = BattleRole::Unknown;
|
||||
std::vector<BattleRole> roles;
|
||||
std::vector<std::string> chars;
|
||||
int promotion = 0; // 晋升 N 个干员
|
||||
bool no_longer_buy = false;
|
||||
bool ignore_no_longer_buy = false;
|
||||
|
||||
@@ -44,6 +44,7 @@ bool asst::RoguelikeShoppingTaskPlugin::_run()
|
||||
json::value json_chars_info = json::parse(str_chars_info).value_or(json::value());
|
||||
|
||||
std::unordered_map<BattleRole, size_t> map_roles_count;
|
||||
std::unordered_set<std::string> chars_list;
|
||||
for (auto& [name, json_info] : json_chars_info.as_object()) {
|
||||
int elite = static_cast<int>(json_info.get("elite", 0));
|
||||
int level = static_cast<int>(json_info.get("level", 0));
|
||||
@@ -54,19 +55,14 @@ bool asst::RoguelikeShoppingTaskPlugin::_run()
|
||||
continue;
|
||||
}
|
||||
|
||||
chars_list.emplace(name);
|
||||
|
||||
if (name == "阿米娅") {
|
||||
map_roles_count[BattleRole::Caster] += 1;
|
||||
map_roles_count[BattleRole::Warrior] += 1;
|
||||
}
|
||||
else {
|
||||
BattleRole role = BattleRole::Unknown;
|
||||
auto int_role = json_info.get("role", 0);
|
||||
if (int_role) {
|
||||
role = static_cast<BattleRole>(int_role);
|
||||
}
|
||||
else {
|
||||
role = Resrc.battle_data().get_role(name);
|
||||
}
|
||||
BattleRole role = Resrc.battle_data().get_role(name);
|
||||
map_roles_count[role] += 1;
|
||||
}
|
||||
}
|
||||
@@ -91,11 +87,29 @@ bool asst::RoguelikeShoppingTaskPlugin::_run()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (goods.role_restriction != BattleRole::Unknown
|
||||
&& map_roles_count[goods.role_restriction] == 0) {
|
||||
Log.trace("Ready to buy", goods.name, static_cast<int>(goods.role_restriction),
|
||||
", but there is no such professional operator, skip");
|
||||
continue;
|
||||
if (!goods.roles.empty()) {
|
||||
bool role_mathced = false;
|
||||
for (const auto& role : goods.roles) {
|
||||
if (map_roles_count[role] != 0) {
|
||||
role_mathced = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!role_mathced) {
|
||||
Log.trace("Ready to buy", goods.name,
|
||||
", but there is no such professional operator, skip");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!goods.chars.empty()) {
|
||||
auto iter = std::find_first_of(chars_list.cbegin(), chars_list.cend(),
|
||||
goods.chars.cbegin(), goods.chars.cend());
|
||||
if (iter == chars_list.cend()) {
|
||||
Log.trace("Ready to buy", goods.name,
|
||||
", but there is no such character, skip");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 这里仅点一下收藏品,原本的 ProcessTask 还会再点一下,但它是由 rect_move 的,保证不会点出去
|
||||
|
||||
@@ -105,8 +105,8 @@
|
||||
<system:String x:Key="PenguinID">Penguin Report ID(Number part only)</system:String>
|
||||
|
||||
<system:String x:Key="SocialPtShop">Social Point shopping</system:String>
|
||||
<system:String x:Key="HighPriority">Whitelist(splited by space)</system:String>
|
||||
<system:String x:Key="Blacklist">Blacklist(splited by space)</system:String>
|
||||
<system:String x:Key="HighPriority">Whitelist(split by space)</system:String>
|
||||
<system:String x:Key="Blacklist">Blacklist(split by space)</system:String>
|
||||
<system:String x:Key="Drink">Would you like a drink🍷? doctor</system:String>
|
||||
|
||||
<system:String x:Key="DroneUsage">Drone Usage</system:String>
|
||||
@@ -257,8 +257,8 @@
|
||||
<system:String x:Key="UnknownAbnormal">Unknown exception occurred</system:String>
|
||||
<system:String x:Key="Error">Error</system:String>
|
||||
<system:String x:Key="InitializationError">Initialization error!</system:String>
|
||||
<system:String x:Key="ResolutionNotSupported">Emulator resolution not supported, please set at leat 720P with 16:9 ratio</system:String>
|
||||
<system:String x:Key="ResolutionAcquisitionFailure">fails to be obtaine mulator resolution . Please restart computer or consider try other emulator</system:String>
|
||||
<system:String x:Key="ResolutionNotSupported">Emulator resolution not supported, please set at least 720P with 16:9 ratio</system:String>
|
||||
<system:String x:Key="ResolutionAcquisitionFailure">fails to be obtain emulator resolution . Please restart computer or consider try other emulator</system:String>
|
||||
<system:String x:Key="TryToReconnect">Emulator disconnected, trying to reconnect</system:String>
|
||||
<system:String x:Key="ReconnectSuccess">Reconnect succeeded. Continue the task</system:String>
|
||||
<system:String x:Key="ReconnectFailed">Reconnect failed. The connection is down!</system:String>
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
<system:String x:Key="Error">エラー</system:String>
|
||||
<system:String x:Key="InitializationError">初期化エラー!</system:String>
|
||||
<system:String x:Key="ResolutionNotSupported">エミュレータの解像度はサポートされていません。アスペクト比16:9で、720p以上に設定してください</system:String>
|
||||
<system:String x:Key="ResolutionAcquisitionFailure">エミュレーターの解像度を取得できませんでした。コンピューターを再起動するか、エミュレーターを変更してから再試行することをお勧めします</system:String>
|
||||
<system:String x:Key="ResolutionAcquisitionFailure">エミュレータの解像度を取得できませんでした。コンピュータを再起動するか、エミュレータを変更してから再試行することをお勧めします</system:String>
|
||||
<system:String x:Key="TryToReconnect">エミュレータが切断されました。再接続しようとしています</system:String>
|
||||
<system:String x:Key="ReconnectSuccess">再接続に成功した。タスクを続行します</system:String>
|
||||
<system:String x:Key="ReconnectFailed">再接続に失敗した。切断されました!</system:String>
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
<system:String x:Key="LaunchOnSystemStartup">開機自動啟動</system:String>
|
||||
<system:String x:Key="RunTaskAfterLaunch">啟動後直接運行</system:String>
|
||||
<system:String x:Key="ClientVersion">客戶端版本</system:String>
|
||||
<system:String x:Key="ClientVersion">用戶端版本</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">啟動後自動開啟模擬器</system:String>
|
||||
<system:String x:Key="WaitForEmulator">等待模擬器啟動時間(秒)</system:String>
|
||||
<system:String x:Key="EmulatorPath">模擬器路徑</system:String>
|
||||
@@ -100,9 +100,9 @@
|
||||
<system:String x:Key="Strategy">策略</system:String>
|
||||
<system:String x:Key="StartTimesLimit">開始次數限制</system:String>
|
||||
<system:String x:Key="GoldTimesLimit">投資次數限制</system:String>
|
||||
<system:String x:Key="StopOnGoldLimit">源石錠達到上限停止任務</system:String>
|
||||
<system:String x:Key="StopOnGoldLimit">源石錠達到上限停止</system:String>
|
||||
|
||||
<system:String x:Key="PenguinID">企鵝物流彙報ID(僅數字部分)</system:String>
|
||||
<system:String x:Key="PenguinID">企鵝物流匯報ID(僅數字部分)</system:String>
|
||||
|
||||
<system:String x:Key="SocialPtShop">信用購物</system:String>
|
||||
<system:String x:Key="HighPriority">優先購買 子串即可 空格分隔</system:String>
|
||||
@@ -111,8 +111,8 @@
|
||||
|
||||
<system:String x:Key="DroneUsage">無人機用途</system:String>
|
||||
|
||||
<system:String x:Key="MinimizeToTray">最小化時隱藏至託盤</system:String>
|
||||
<system:String x:Key="SystemNotification">重要資訊彈出系統通知</system:String>
|
||||
<system:String x:Key="MinimizeToTray">最小化時隱藏至托盤</system:String>
|
||||
<system:String x:Key="SystemNotification">重要訊息彈出系統通知</system:String>
|
||||
<system:String x:Key="HideUnavailableStage">關卡選擇隱藏當日不開放關卡</system:String>
|
||||
<system:String x:Key="MainViewButtonFeature">主介面可選擇按鈕功能</system:String>
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
<system:String x:Key="PR-CTip">先/輔晶片</system:String>
|
||||
<system:String x:Key="PR-DTip">近/特晶片</system:String>
|
||||
<system:String x:Key="Pormpt1">週一了,可以打剿滅了~</system:String>
|
||||
<system:String x:Key="Pormpt2">周日了,記得打剿滅喔~</system:String>
|
||||
<system:String x:Key="Pormpt2">週日了,記得打剿滅喔~</system:String>
|
||||
<!-- 戰鬥設定 -->
|
||||
|
||||
<!-- 日誌 -->
|
||||
@@ -234,7 +234,7 @@
|
||||
<system:String x:Key="Start">開始</system:String>
|
||||
|
||||
<system:String x:Key="CopilotJSONSharing">作業分享站</system:String>
|
||||
<system:String x:Key="VideoLink">視頻鏈接</system:String>
|
||||
<system:String x:Key="VideoLink">影片連結</system:String>
|
||||
|
||||
<!-- 日誌 -->
|
||||
<system:String x:Key="CopilotTip">小提示:</system:String>
|
||||
@@ -270,7 +270,7 @@
|
||||
<system:String x:Key="StartCombat">開始戰鬥:</system:String>
|
||||
<system:String x:Key="CompleteCombat">完成戰鬥:</system:String>
|
||||
<system:String x:Key="AllTasksComplete">任務已全部完成!</system:String>
|
||||
<system:String x:Key="FailedToOpenClient">打開客戶端失敗,請檢查配置檔</system:String>
|
||||
<system:String x:Key="FailedToOpenClient">打開用戶端失敗,請檢查配置檔</system:String>
|
||||
<system:String x:Key="ErrorOccurred">出現錯誤</system:String>
|
||||
<system:String x:Key="HasReturned">已返回</system:String>
|
||||
<system:String x:Key="DropRecognitionError">掉落識別錯誤</system:String>
|
||||
@@ -326,7 +326,7 @@
|
||||
|
||||
<!-- About -->
|
||||
<system:String x:Key="Website">MAA 官網</system:String>
|
||||
<system:String x:Key="Github">源碼:GitHub</system:String>
|
||||
<system:String x:Key="Github">原始碼:GitHub</system:String>
|
||||
<system:String x:Key="QQgroup">自動戰鬥作業分享 Q 群</system:String>
|
||||
<system:String x:Key="QQgroup1">一群</system:String>
|
||||
<system:String x:Key="QQgroup2">二群</system:String>
|
||||
|
||||
@@ -90,17 +90,17 @@ namespace MeoAsstGui
|
||||
// LogItemViewModels.Insert(0, new LogItemViewModel(time + content, color, weight));
|
||||
}
|
||||
|
||||
private bool _idel = true;
|
||||
private bool _idle = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether it is idle.
|
||||
/// </summary>
|
||||
public bool Idle
|
||||
{
|
||||
get => _idel;
|
||||
get => _idle;
|
||||
set
|
||||
{
|
||||
_idel = value;
|
||||
_idle = value;
|
||||
NotifyOfPropertyChange(() => Idle);
|
||||
}
|
||||
}
|
||||
@@ -275,13 +275,13 @@ namespace MeoAsstGui
|
||||
{
|
||||
count++;
|
||||
string group_name = group["name"] + ": ";
|
||||
var operinfos = new List<string>();
|
||||
var operInfos = new List<string>();
|
||||
foreach (JObject oper in group["opers"])
|
||||
{
|
||||
operinfos.Add(string.Format("{0} {1}", oper["name"], oper["skill"]));
|
||||
operInfos.Add(string.Format("{0} {1}", oper["name"], oper["skill"]));
|
||||
}
|
||||
|
||||
AddLog(group_name + string.Join(" / ", operinfos), "black");
|
||||
AddLog(group_name + string.Join(" / ", operInfos), "black");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ namespace MeoAsstGui
|
||||
set => SetAndNotify(ref _form, value);
|
||||
}
|
||||
|
||||
private bool _catched = false;
|
||||
private bool _caught = false;
|
||||
|
||||
/// <summary>
|
||||
/// Starts copilot.
|
||||
@@ -381,8 +381,8 @@ namespace MeoAsstGui
|
||||
{
|
||||
return asstProxy.AsstConnect(ref errMsg);
|
||||
});
|
||||
_catched = await task;
|
||||
if (!_catched)
|
||||
_caught = await task;
|
||||
if (!_caught)
|
||||
{
|
||||
AddLog(errMsg, "DarkRed");
|
||||
return;
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace MeoAsstGui
|
||||
}
|
||||
}
|
||||
|
||||
private bool _catched = false;
|
||||
private bool _caught = false;
|
||||
|
||||
/// <summary>
|
||||
/// Starts calculation.
|
||||
@@ -169,8 +169,8 @@ namespace MeoAsstGui
|
||||
{
|
||||
return asstProxy.AsstConnect(ref errMsg);
|
||||
});
|
||||
_catched = await task;
|
||||
if (!_catched)
|
||||
_caught = await task;
|
||||
if (!_caught)
|
||||
{
|
||||
RecruitInfo = errMsg;
|
||||
return;
|
||||
|
||||
@@ -1430,10 +1430,10 @@ namespace MeoAsstGui
|
||||
// TODO: 你确定要用 async void 不是 async Task?
|
||||
public async void ManualUpdate()
|
||||
{
|
||||
var updateModle = _container.Get<VersionUpdateViewModel>();
|
||||
var updateModel = _container.Get<VersionUpdateViewModel>();
|
||||
var task = Task.Run(() =>
|
||||
{
|
||||
if (!updateModle.CheckAndDownloadUpdate(true))
|
||||
if (!updateModel.CheckAndDownloadUpdate(true))
|
||||
{
|
||||
Execute.OnUIThread(() =>
|
||||
{
|
||||
@@ -1465,7 +1465,7 @@ namespace MeoAsstGui
|
||||
{
|
||||
SetAndNotify(ref _connectAddress, value);
|
||||
ViewStatusStorage.Set("Connect.Address", value);
|
||||
UpdateWindowTitle(); /* 每次修改连接地址时更新WIndowTitle */
|
||||
UpdateWindowTitle(); /* 每次修改连接地址时更新WindowTitle */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1657,14 +1657,14 @@ namespace MeoAsstGui
|
||||
public bool UseTray = true;
|
||||
#pragma warning restore SA1401 // Fields should be private
|
||||
|
||||
// private bool _usetray = Convert.ToBoolean(ViewStatusStorage.Get("GUI.UseTray", bool.TrueString));
|
||||
// private bool _useTray = Convert.ToBoolean(ViewStatusStorage.Get("GUI.UseTray", bool.TrueString));
|
||||
|
||||
// public bool UseTray
|
||||
// {
|
||||
// get { return _usetray; }
|
||||
// get { return _useTray; }
|
||||
// set
|
||||
// {
|
||||
// SetAndNotify(ref _usetray, value);
|
||||
// SetAndNotify(ref _useTray, value);
|
||||
// ViewStatusStorage.Set("GUI.UseTray", value.ToString());
|
||||
// var trayObj = _container.Get<TrayIcon>();
|
||||
// trayObj.SetVisible(value);
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace MeoAsstGui
|
||||
/// </summary>
|
||||
public ObservableCollection<LogItemViewModel> LogItemViewModels { get; set; }
|
||||
|
||||
private string _actionAfterComplated = ViewStatusStorage.Get("MainFunction.ActionAfterComplated", ActionType.DoNothing.ToString());
|
||||
private string _actionAfterCompleted = ViewStatusStorage.Get("MainFunction.ActionAfterCompleted", ActionType.DoNothing.ToString());
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of the actions after completion.
|
||||
@@ -58,7 +58,7 @@ namespace MeoAsstGui
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Enum.TryParse(_actionAfterComplated, out ActionType action))
|
||||
if (Enum.TryParse(_actionAfterCompleted, out ActionType action))
|
||||
{
|
||||
return action;
|
||||
}
|
||||
@@ -68,14 +68,14 @@ namespace MeoAsstGui
|
||||
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _actionAfterComplated, value.ToString());
|
||||
SetAndNotify(ref _actionAfterCompleted, value.ToString());
|
||||
string storeValue = ActionType.DoNothing.ToString();
|
||||
if (value != ActionType.Shutdown && value != ActionType.Hibernate)
|
||||
{
|
||||
storeValue = value.ToString();
|
||||
}
|
||||
|
||||
ViewStatusStorage.Set("MainFunction.ActionAfterComplated", storeValue);
|
||||
ViewStatusStorage.Set("MainFunction.ActionAfterCompleted", storeValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,8 +634,8 @@ namespace MeoAsstGui
|
||||
{
|
||||
return asstProxy.AsstConnect(ref errMsg, true);
|
||||
});
|
||||
bool catchd = await task;
|
||||
if (!catchd)
|
||||
bool caught = await task;
|
||||
if (!caught)
|
||||
{
|
||||
AddLog(errMsg, "darkred");
|
||||
var settingsModel = _container.Get<SettingsViewModel>();
|
||||
@@ -648,8 +648,8 @@ namespace MeoAsstGui
|
||||
{
|
||||
return asstProxy.AsstConnect(ref errMsg);
|
||||
});
|
||||
catchd = await task;
|
||||
if (!catchd)
|
||||
caught = await task;
|
||||
if (!caught)
|
||||
{
|
||||
AddLog(errMsg, "darkred");
|
||||
Idle = true;
|
||||
@@ -869,8 +869,8 @@ namespace MeoAsstGui
|
||||
}
|
||||
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
bool setted = asstProxy.AsstSetFightTaskParams(Stage, medicine, stone, times, DropsItemId, drops_quantity);
|
||||
if (setted)
|
||||
bool isSet = asstProxy.AsstSetFightTaskParams(Stage, medicine, stone, times, DropsItemId, drops_quantity);
|
||||
if (isSet)
|
||||
{
|
||||
AddLog(Localization.GetString("SetSuccessfully"), "Black");
|
||||
}
|
||||
@@ -955,7 +955,7 @@ namespace MeoAsstGui
|
||||
/// Kills emulator.
|
||||
/// </summary>
|
||||
/// <returns>Whether the operation is successful.</returns>
|
||||
public bool killemulator()
|
||||
public bool killEmulator()
|
||||
{
|
||||
int pid = 0;
|
||||
string port;
|
||||
@@ -969,22 +969,22 @@ namespace MeoAsstGui
|
||||
port = "5555";
|
||||
}
|
||||
|
||||
string portcmd = "netstat -ano|findstr \"" + port + "\"";
|
||||
Process checkcmd = new Process();
|
||||
checkcmd.StartInfo.FileName = "cmd.exe";
|
||||
checkcmd.StartInfo.UseShellExecute = false;
|
||||
checkcmd.StartInfo.RedirectStandardInput = true;
|
||||
checkcmd.StartInfo.RedirectStandardOutput = true;
|
||||
checkcmd.StartInfo.RedirectStandardError = true;
|
||||
checkcmd.StartInfo.CreateNoWindow = true;
|
||||
checkcmd.Start();
|
||||
checkcmd.StandardInput.WriteLine(portcmd);
|
||||
checkcmd.StandardInput.WriteLine("exit");
|
||||
string portCmd = "netstat -ano|findstr \"" + port + "\"";
|
||||
Process checkCmd = new Process();
|
||||
checkCmd.StartInfo.FileName = "cmd.exe";
|
||||
checkCmd.StartInfo.UseShellExecute = false;
|
||||
checkCmd.StartInfo.RedirectStandardInput = true;
|
||||
checkCmd.StartInfo.RedirectStandardOutput = true;
|
||||
checkCmd.StartInfo.RedirectStandardError = true;
|
||||
checkCmd.StartInfo.CreateNoWindow = true;
|
||||
checkCmd.Start();
|
||||
checkCmd.StandardInput.WriteLine(portCmd);
|
||||
checkCmd.StandardInput.WriteLine("exit");
|
||||
Regex reg = new Regex("\\s+", RegexOptions.Compiled);
|
||||
string line;
|
||||
while (true)
|
||||
{
|
||||
line = checkcmd.StandardOutput.ReadLine();
|
||||
line = checkCmd.StandardOutput.ReadLine();
|
||||
try
|
||||
{
|
||||
line = line.Trim();
|
||||
@@ -1093,11 +1093,11 @@ namespace MeoAsstGui
|
||||
// Shutdown 会调用 OnExit 但 Exit 不会
|
||||
Application.Current.Shutdown();
|
||||
|
||||
// Enviroment.Exit(0);
|
||||
// Environment.Exit(0);
|
||||
break;
|
||||
|
||||
case ActionType.ExitEmulator:
|
||||
if (!killemulator())
|
||||
if (!killEmulator())
|
||||
{
|
||||
AddLog(Localization.GetString("CloseEmulatorFailed"), "DarkRed");
|
||||
}
|
||||
@@ -1105,7 +1105,7 @@ namespace MeoAsstGui
|
||||
break;
|
||||
|
||||
case ActionType.ExitEmulatorAndSelf:
|
||||
if (!killemulator())
|
||||
if (!killEmulator())
|
||||
{
|
||||
AddLog(Localization.GetString("CloseEmulatorFailed"), "DarkRed");
|
||||
}
|
||||
@@ -1113,7 +1113,7 @@ namespace MeoAsstGui
|
||||
// Shutdown 会调用 OnExit 但 Exit 不会
|
||||
Application.Current.Shutdown();
|
||||
|
||||
// Enviroment.Exit(0);
|
||||
// Environment.Exit(0);
|
||||
break;
|
||||
|
||||
case ActionType.Shutdown:
|
||||
|
||||
@@ -256,9 +256,9 @@ namespace MeoAsstGui
|
||||
|
||||
// 程序正在运行中,部分文件是无法覆写的,这里曲线操作下
|
||||
// 先将当前这些文件重命名,然后再把新的复制过来
|
||||
foreach (var oldfile in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.old"))
|
||||
foreach (var oldFile in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.old"))
|
||||
{
|
||||
File.Delete(oldfile);
|
||||
File.Delete(oldFile);
|
||||
}
|
||||
|
||||
foreach (var file in uncopiedList)
|
||||
@@ -451,11 +451,11 @@ namespace MeoAsstGui
|
||||
|
||||
Semver.SemVersion curVersionObj;
|
||||
bool curParsed = Semver.SemVersion.TryParse(_curVersion, Semver.SemVersionStyles.AllowLowerV, out curVersionObj);
|
||||
Semver.SemVersion lastestVersionObj;
|
||||
bool lastestPared = Semver.SemVersion.TryParse(_latestVersion, Semver.SemVersionStyles.AllowLowerV, out lastestVersionObj);
|
||||
if (curParsed && lastestPared)
|
||||
Semver.SemVersion latestVersionObj;
|
||||
bool latestPared = Semver.SemVersion.TryParse(_latestVersion, Semver.SemVersionStyles.AllowLowerV, out latestVersionObj);
|
||||
if (curParsed && latestPared)
|
||||
{
|
||||
if (curVersionObj.CompareSortOrderTo(lastestVersionObj) >= 0)
|
||||
if (curVersionObj.CompareSortOrderTo(latestVersionObj) >= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user