mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-13 15:57:14 +03:00
Add checks to `Died
` event
This commit is contained in:
parent
68a2767c39
commit
249f89f0fe
@ -1001,7 +1001,17 @@ def journal_entry( # noqa: C901, CCR001
|
||||
elif 'KillerName' in entry:
|
||||
data['opponentName'] = entry['KillerName']
|
||||
|
||||
new_add_event('addCommanderCombatDeath', entry['timestamp'], data)
|
||||
elif 'KillerShip' in entry:
|
||||
data['opponentName'] = entry['KillerShip']
|
||||
|
||||
# Paranoia in case of e.g. Thargoid activity not having complete data
|
||||
opponent_name_issue = 'opponentName' not in data or data['opponentName'] == ""
|
||||
wing_opponent_names_issue = 'wingOpponentNames' not in data or data['wingOpponentNames'] == []
|
||||
if opponent_name_issue and wing_opponent_names_issue:
|
||||
logger.warning('Dropping addCommanderCombatDeath message because opponentName and wingOpponentNames came out as ""')
|
||||
|
||||
else:
|
||||
new_add_event('addCommanderCombatDeath', entry['timestamp'], data)
|
||||
|
||||
elif event_name == 'Interdicted':
|
||||
data = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user