mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-15 00:30:33 +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:
|
elif 'Power' in entry:
|
||||||
data['opponentName'] = entry['Power']
|
data['opponentName'] = entry['Power']
|
||||||
|
|
||||||
|
# Paranoia in case of e.g. Thargoid activity not having complete data
|
||||||
if data['opponentName'] == "":
|
if data['opponentName'] == "":
|
||||||
logger.warning('Dropping addCommanderCombatInterdicted message because opponentName came out as ""')
|
logger.warning('Dropping addCommanderCombatInterdicted message because opponentName came out as ""')
|
||||||
|
|
||||||
@ -1091,6 +1092,7 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
elif 'Power' in entry:
|
elif 'Power' in entry:
|
||||||
data['opponentName'] = entry['Power']
|
data['opponentName'] = entry['Power']
|
||||||
|
|
||||||
|
# Paranoia in case of e.g. Thargoid activity not having complete data
|
||||||
if data['opponentName'] == "":
|
if data['opponentName'] == "":
|
||||||
logger.warning('Dropping addCommanderCombatInterdiction message because opponentName came out as ""')
|
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)
|
new_add_event('addCommanderCombatInterdiction', entry['timestamp'], data)
|
||||||
|
|
||||||
elif event_name == 'EscapeInterdiction':
|
elif event_name == 'EscapeInterdiction':
|
||||||
new_add_event(
|
# Paranoia in case of e.g. Thargoid activity not having complete data
|
||||||
'addCommanderCombatInterdictionEscape',
|
if entry.get('Interdictor') is None or entry['Interdictor'] == "":
|
||||||
entry['timestamp'],
|
logger.warning(
|
||||||
{
|
'Dropping addCommanderCombatInterdictionEscape message'
|
||||||
'starsystemName': system,
|
'because opponentName came out as ""'
|
||||||
'opponentName': entry['Interdictor'],
|
)
|
||||||
'isPlayer': entry['IsPlayer'],
|
|
||||||
}
|
else:
|
||||||
)
|
new_add_event(
|
||||||
|
'addCommanderCombatInterdictionEscape',
|
||||||
|
entry['timestamp'],
|
||||||
|
{
|
||||||
|
'starsystemName': system,
|
||||||
|
'opponentName': entry['Interdictor'],
|
||||||
|
'isPlayer': entry['IsPlayer'],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
elif event_name == 'PVPKill':
|
elif event_name == 'PVPKill':
|
||||||
new_add_event(
|
new_add_event(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user