1.2.0: Refined all 6D calcs and UI/UX Experiences.
This commit is contained in:
@@ -117,6 +117,13 @@ class PlayerStats:
|
||||
year: str = ""
|
||||
sts_raw: str = ""
|
||||
level_info_raw: str = ""
|
||||
|
||||
# Utility Usage
|
||||
util_flash_usage: int = 0
|
||||
util_smoke_usage: int = 0
|
||||
util_molotov_usage: int = 0
|
||||
util_he_usage: int = 0
|
||||
util_decoy_usage: int = 0
|
||||
|
||||
@dataclass
|
||||
class RoundEvent:
|
||||
@@ -799,6 +806,22 @@ class MatchParser:
|
||||
round_list = l_data.get('round_stat', [])
|
||||
|
||||
for idx, r in enumerate(round_list):
|
||||
# Utility Usage (Leetify)
|
||||
bron = r.get('bron_equipment', {})
|
||||
for sid, items in bron.items():
|
||||
sid = str(sid)
|
||||
if sid in self.match_data.players:
|
||||
p = self.match_data.players[sid]
|
||||
if isinstance(items, list):
|
||||
for item in items:
|
||||
if not isinstance(item, dict): continue
|
||||
name = item.get('WeaponName', '')
|
||||
if name == 'weapon_flashbang': p.util_flash_usage += 1
|
||||
elif name == 'weapon_smokegrenade': p.util_smoke_usage += 1
|
||||
elif name in ['weapon_molotov', 'weapon_incgrenade']: p.util_molotov_usage += 1
|
||||
elif name == 'weapon_hegrenade': p.util_he_usage += 1
|
||||
elif name == 'weapon_decoy': p.util_decoy_usage += 1
|
||||
|
||||
rd = RoundData(
|
||||
round_num=r.get('round', idx + 1),
|
||||
winner_side='CT' if r.get('win_reason') in [7, 8, 9] else 'T', # Approximate logic, need real enum
|
||||
@@ -949,6 +972,21 @@ class MatchParser:
|
||||
# Check schema: 'current_score' -> ct/t
|
||||
cur_score = r.get('current_score', {})
|
||||
|
||||
# Utility Usage (Classic)
|
||||
equiped = r.get('equiped', {})
|
||||
for sid, items in equiped.items():
|
||||
# Ensure sid is string
|
||||
sid = str(sid)
|
||||
if sid in self.match_data.players:
|
||||
p = self.match_data.players[sid]
|
||||
if isinstance(items, list):
|
||||
for item in items:
|
||||
if item == 'flashbang': p.util_flash_usage += 1
|
||||
elif item == 'smokegrenade': p.util_smoke_usage += 1
|
||||
elif item in ['molotov', 'incgrenade']: p.util_molotov_usage += 1
|
||||
elif item == 'hegrenade': p.util_he_usage += 1
|
||||
elif item == 'decoy': p.util_decoy_usage += 1
|
||||
|
||||
rd = RoundData(
|
||||
round_num=idx + 1,
|
||||
winner_side='None', # Default to None if unknown
|
||||
@@ -1214,7 +1252,8 @@ def save_match(cursor, m: MatchData):
|
||||
"many_assists_cnt3", "many_assists_cnt4", "many_assists_cnt5", "map",
|
||||
"match_code", "match_mode", "match_team_id", "match_time", "per_headshot",
|
||||
"perfect_kill", "planted_bomb", "revenge_kill", "round_total", "season",
|
||||
"team_kill", "throw_harm", "throw_harm_enemy", "uid", "year", "sts_raw", "level_info_raw"
|
||||
"team_kill", "throw_harm", "throw_harm_enemy", "uid", "year", "sts_raw", "level_info_raw",
|
||||
"util_flash_usage", "util_smoke_usage", "util_molotov_usage", "util_he_usage", "util_decoy_usage"
|
||||
]
|
||||
player_placeholders = ",".join(["?"] * len(player_columns))
|
||||
player_columns_sql = ",".join(player_columns)
|
||||
@@ -1238,7 +1277,8 @@ def save_match(cursor, m: MatchData):
|
||||
p.many_assists_cnt5, p.map, p.match_code, p.match_mode, p.match_team_id,
|
||||
p.match_time, p.per_headshot, p.perfect_kill, p.planted_bomb, p.revenge_kill,
|
||||
p.round_total, p.season, p.team_kill, p.throw_harm, p.throw_harm_enemy,
|
||||
p.uid, p.year, p.sts_raw, p.level_info_raw
|
||||
p.uid, p.year, p.sts_raw, p.level_info_raw,
|
||||
p.util_flash_usage, p.util_smoke_usage, p.util_molotov_usage, p.util_he_usage, p.util_decoy_usage
|
||||
]
|
||||
|
||||
for sid, p in m.players.items():
|
||||
|
||||
Reference in New Issue
Block a user