0.4.4 : L2 ver3 fixed several empty stats in L2.

This commit is contained in:
2026-01-24 02:32:31 +08:00
parent 7ab9df2acf
commit 01451c0b4b
4 changed files with 103 additions and 66 deletions

View File

@@ -643,6 +643,16 @@ class MatchParser:
side_stats.throw_harm_enemy = safe_int(fight_side.get('throw_harm_enemy'))
side_stats.uid = safe_int(fight_side.get('uid'))
side_stats.year = safe_text(fight_side.get('year'))
# Map missing fields
side_stats.clutch_1v1 = side_stats.end_1v1
side_stats.clutch_1v2 = side_stats.end_1v2
side_stats.clutch_1v3 = side_stats.end_1v3
side_stats.clutch_1v4 = side_stats.end_1v4
side_stats.clutch_1v5 = side_stats.end_1v5
side_stats.entry_kills = side_stats.first_kill
side_stats.entry_deaths = side_stats.first_death
return side_stats
team_id_value = safe_int(fight.get('match_team_id'))
@@ -725,6 +735,15 @@ class MatchParser:
stats.uid = safe_int(fight.get('uid'))
stats.year = safe_text(fight.get('year'))
# Map missing fields
stats.clutch_1v1 = stats.end_1v1
stats.clutch_1v2 = stats.end_1v2
stats.clutch_1v3 = stats.end_1v3
stats.clutch_1v4 = stats.end_1v4
stats.clutch_1v5 = stats.end_1v5
stats.entry_kills = stats.first_kill
stats.entry_deaths = stats.first_death
except Exception as e:
logger.error(f"Error parsing stats for {steam_id} in {self.match_id}: {e}")
pass
@@ -754,6 +773,9 @@ class MatchParser:
p.fd_t = int(vdata.get('fd_t', 0))
p.damage_receive = int(vdata.get('damage_receive', 0))
p.damage_stats = int(vdata.get('damage_stats', 0))
p.damage_total = int(vdata.get('damage_total', 0))
p.damage_received = int(vdata.get('damage_received', 0))
p.flash_assists = int(vdata.get('flash_assists', 0))
else:
# Try to match by 5E ID if possible, but here keys are steamids usually
pass
@@ -888,12 +910,26 @@ class MatchParser:
equipment_value = player_bron_crash.get(str(sid))
equipment_value = int(equipment_value) if equipment_value is not None else 0
main_weapon = pick_main_weapon(items)
has_helmet = False
has_defuser = False
if isinstance(items, list):
for it in items:
if isinstance(it, dict):
name = it.get('WeaponName', '')
if name == 'item_assaultsuit':
has_helmet = True
elif name == 'item_defuser':
has_defuser = True
rd.economies.append(PlayerEconomy(
steam_id_64=str(sid),
side=side,
start_money=start_money,
equipment_value=equipment_value,
main_weapon=main_weapon,
has_helmet=has_helmet,
has_defuser=has_defuser,
round_performance_score=float(score)
))