Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
chore(pg): welfare(1007,1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Jun 25, 2024
1 parent 06b17c7 commit dda21fd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/pg/PgEntry.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ def do_welfare_list():
for task in tasks:
task_id = task["taskId"]
task_title = task["title"]
task_index = task["index"]
task_status = task["status"]
if task_status == 0:
welfare_complete(task_id, task_title, task_index)
welfare_complete(task_id, task_title)


def refresh_welfare_list():
Expand All @@ -187,7 +186,7 @@ def refresh_welfare_list():
send_content += ">任务失败: 刷新任务出错\n"


def welfare_complete(task_id, task_title, task_index):
def welfare_complete(task_id, task_title):
global send_content
if task_id == 1001:
# print("本日启动1次和平精英")
Expand Down Expand Up @@ -221,7 +220,10 @@ def welfare_complete(task_id, task_title, task_index):
send_content += ">任务失败: 分享资讯出错\n"
elif task_id == 1007:
# print("本日在“和平营地”对资讯进行一次充能")
send_content += ">任务失败: 无法充能资讯\n"
if HttpApi.recharge("1103860286", "1") is not None:
send_content += ">任务成功: 充能资讯完成\n"
else:
send_content += ">任务失败: 充能资讯出错\n"
elif task_id == 1008:
# print("本日浏览1次攻略专区")
send_content += ">任务失败: 无法浏览攻略\n"
Expand Down Expand Up @@ -276,6 +278,9 @@ def welfare_complete(task_id, task_title, task_index):
send_content += ">任务失败: 点赞动态出错\n"
else:
send_content += ">任务失败: 获取动态出错\n"
elif task_id == 1014:
# print("本日在营地进行一次好友观战")
send_content += ">任务失败: 无法观战好友\n"
else:
send_content += f">未知任务: {task_id}-{task_title}\n"

Expand Down
11 changes: 11 additions & 0 deletions src/pg/http/HttpApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,14 @@ def share(action, action_id):
}
)
return resp_json


def recharge(info_id, count):
resp_json = HttpUtil.post_api(
"/game/recharge",
{
"iInfoId": info_id,
"rechargeCnt": count,
}
)
return resp_json

0 comments on commit dda21fd

Please sign in to comment.