Sync rosters at match start, harden dedup and TIME handling, add scoreboard and damage summary
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
+10
-1
@@ -243,7 +243,12 @@ class EventDeduplicator:
|
||||
if event_type not in ('PLAYER_DEATH', 'PLAYER_KILL'):
|
||||
return False
|
||||
|
||||
signature = f"KILL:{time_val}:{killer_name}:{victim_name}"
|
||||
# Signatures use stripped names: the double-emitted PLAYER_KILL and
|
||||
# PLAYER_DEATH for one frag can carry cosmetically different name
|
||||
# strings (color codes/whitespace), which would defeat the match
|
||||
signature = (f"KILL:{time_val}:"
|
||||
f"{strip_color_codes(killer_name).strip()}:"
|
||||
f"{strip_color_codes(victim_name).strip()}")
|
||||
|
||||
if signature in self.recent_events:
|
||||
logger.debug(f'Duplicate event: {signature}')
|
||||
@@ -256,6 +261,10 @@ class EventDeduplicator:
|
||||
|
||||
return False
|
||||
|
||||
def reset(self):
|
||||
"""Clear the signature buffer (match start: TIME restarts at 0)"""
|
||||
self.recent_events = []
|
||||
|
||||
|
||||
class VoteTracker:
|
||||
"""Tracks cast subjects of the running vote; reset on each vote call"""
|
||||
|
||||
Reference in New Issue
Block a user