Populate team rosters from a LIVESTATS team token and tag the damage list
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
+12
-3
@@ -149,16 +149,25 @@ class PlayerTracker:
|
||||
return True
|
||||
return False
|
||||
|
||||
def update_livestats(self, clean_name, score, dealt, taken, ping):
|
||||
"""Update live score/damage/ping from a LIVESTATS console print (clean name)"""
|
||||
def update_livestats(self, clean_name, score, dealt, taken, ping, team=None):
|
||||
"""Update live score/damage/ping from a LIVESTATS console print (clean name).
|
||||
With a team token (extended livedamage format) the team is authoritative —
|
||||
it sorts tracked players and adds unknown ones to the roster, which is
|
||||
what populates teams correctly during warmup."""
|
||||
for player_name, player_data in self.server_info.players.items():
|
||||
if strip_color_codes(player_name) == clean_name:
|
||||
player_data['score'] = str(score)
|
||||
player_data['ping'] = str(ping)
|
||||
player_data['dealt'] = str(dealt)
|
||||
player_data['taken'] = str(taken)
|
||||
if team is not None:
|
||||
self.update_team(player_name, team)
|
||||
return True
|
||||
return False
|
||||
if team is None:
|
||||
return False
|
||||
self.add_player(clean_name, score=str(score), ping=str(ping))
|
||||
self.update_team(clean_name, team)
|
||||
return True
|
||||
|
||||
def remove_player(self, name):
|
||||
"""Remove player from tracking"""
|
||||
|
||||
Reference in New Issue
Block a user