mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-13 07:47:14 +03:00
Inara: Also check opponentName on EscapeInterdiction
And sprinkly comments around giving a reason for the checks.
This commit is contained in:
parent
aac660fb05
commit
26413177a6
@ -1069,6 +1069,7 @@ def journal_entry( # noqa: C901, CCR001
|
||||
elif 'Power' in entry:
|
||||
data['opponentName'] = entry['Power']
|
||||
|
||||
# Paranoia in case of e.g. Thargoid activity not having complete data
|
||||
if data['opponentName'] == "":
|
||||
logger.warning('Dropping addCommanderCombatInterdicted message because opponentName came out as ""')
|
||||
|
||||
@ -1091,6 +1092,7 @@ def journal_entry( # noqa: C901, CCR001
|
||||
elif 'Power' in entry:
|
||||
data['opponentName'] = entry['Power']
|
||||
|
||||
# Paranoia in case of e.g. Thargoid activity not having complete data
|
||||
if data['opponentName'] == "":
|
||||
logger.warning('Dropping addCommanderCombatInterdiction message because opponentName came out as ""')
|
||||
|
||||
@ -1098,15 +1100,23 @@ def journal_entry( # noqa: C901, CCR001
|
||||
new_add_event('addCommanderCombatInterdiction', entry['timestamp'], data)
|
||||
|
||||
elif event_name == 'EscapeInterdiction':
|
||||
new_add_event(
|
||||
'addCommanderCombatInterdictionEscape',
|
||||
entry['timestamp'],
|
||||
{
|
||||
'starsystemName': system,
|
||||
'opponentName': entry['Interdictor'],
|
||||
'isPlayer': entry['IsPlayer'],
|
||||
}
|
||||
)
|
||||
# Paranoia in case of e.g. Thargoid activity not having complete data
|
||||
if entry.get('Interdictor') is None or entry['Interdictor'] == "":
|
||||
logger.warning(
|
||||
'Dropping addCommanderCombatInterdictionEscape message'
|
||||
'because opponentName came out as ""'
|
||||
)
|
||||
|
||||
else:
|
||||
new_add_event(
|
||||
'addCommanderCombatInterdictionEscape',
|
||||
entry['timestamp'],
|
||||
{
|
||||
'starsystemName': system,
|
||||
'opponentName': entry['Interdictor'],
|
||||
'isPlayer': entry['IsPlayer'],
|
||||
}
|
||||
)
|
||||
|
||||
elif event_name == 'PVPKill':
|
||||
new_add_event(
|
||||
|
Loading…
x
Reference in New Issue
Block a user