idac: updated scripts + bugfixes, BACKUP DATABASE!

This commit is contained in:
Dniel97
2024-01-08 18:36:46 +01:00
parent 9ee58cd444
commit 7639c2ef74
4 changed files with 47 additions and 24 deletions

View File

@@ -600,6 +600,7 @@ class IDACSeason2(IDACBase):
vs_info["str_now"] = vs_info["str_now"] + data.get("win_flg") if data.get("win_flg") == 1 else 0
vs_info["str"] = vs_info["str"] if vs_info["str"] > vs_info["str_now"] else vs_info["str_now"]
vs_info["lose_now"] += 1 if data.get("win_flg") == 0 else 0
vs_info["vs_history"] = data.get("vs_history")
vs_info["break_count"] += data.get("break_count")
vs_info["break_penalty_flag"] = data.get("break_penalty_flag")
@@ -642,21 +643,22 @@ class IDACSeason2(IDACBase):
else:
vs_info = {
"battle_mode": battle_mode,
#"vs_cnt": 1,
#"vs_win": data.get("win_flg"),
# "vs_cnt": 1,
# "vs_win": data.get("win_flg"),
"invalid": data.get("result"),
"str": data.get("win_flg"),
"str_now": data.get("win_flg"),
"lose_now": 1 if data.get("win_flg") == 0 else 0,
"vs_history": data.get("vs_history"),
"break_count": data.get("break_count"),
"break_penalty_flag": data.get("break_penalty_flag"),
#"vsinfo_course_data": [
# {
# "course_id": data.get("course_id"),
# "vs_cnt": 1,
# "vs_win": data.get("win_flg")
# }
#],
# "vsinfo_course_data": [
# {
# "course_id": data.get("course_id"),
# "vs_cnt": 1,
# "vs_win": data.get("win_flg")
# }
# ],
}
self.data.item.put_vs_info(user_id, battle_mode, vs_info)
@@ -672,7 +674,6 @@ class IDACSeason2(IDACBase):
vs_info["vsinfo_course_data"] = []
vs_info["vsinfo_course_data"].append(course_info)
vs_info["vs_history"] = data.get("vs_history")
vs_info["course_select_priority"] = data.get("course_select_priority")
return vs_info
@@ -804,12 +805,12 @@ class IDACSeason2(IDACBase):
if vs_info is not None:
for vs in vs_info:
vs = vs._asdict()
vs_courses_info = self.data.item.get_vs_course_info_by_mode(user_id, vs["battle_mode"])
vs_courses_infos = self.data.item.get_vs_course_infos_by_mode(user_id, vs["battle_mode"])
total_vs_win = 0
total_vs_cnt = 0
courses_info = []
if vs_courses_info is not None:
for course in vs_courses_info:
if vs_courses_infos is not None:
for course in vs_courses_infos:
tmp = course._asdict()
del tmp["id"]
del tmp["user"]
@@ -830,8 +831,10 @@ class IDACSeason2(IDACBase):
"str": vs["str"],
"str_now": vs["str_now"],
"lose_now": vs["lose_now"],
"vs_history": 0,
"vs_history": vs["vs_history"],
"course_select_priority": 0,
"break_count": vs["break_count"],
"break_penalty_flag": vs["break_penalty_flag"],
"vsinfo_course_data": courses_info,
}
)