mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-05-29 14:49:29 +03:00
Check for `EscapeInterdiction
` events as well
Also rewrites the ``EscapeInterdiction`` path to match the other Interdiction paths.
This commit is contained in:
parent
af3b9d250a
commit
a45527e104
@ -1058,23 +1058,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':
|
||||||
|
data = {
|
||||||
|
'starsystemName': system,
|
||||||
|
'isPlayer': entry['IsPlayer'],
|
||||||
|
}
|
||||||
|
|
||||||
|
if 'Interdictor' in entry:
|
||||||
|
data['opponentName'] = entry['Interdictor']
|
||||||
|
|
||||||
|
elif 'isThargoid' in entry and entry['isThargoid']:
|
||||||
|
data['opponentName'] = 'Thargoid'
|
||||||
|
|
||||||
# Paranoia in case of e.g. Thargoid activity not having complete data
|
# Paranoia in case of e.g. Thargoid activity not having complete data
|
||||||
if entry.get('Interdictor') is None or entry['Interdictor'] == "":
|
if 'opponentName' not in data or data['opponentName'] == "":
|
||||||
logger.warning(
|
logger.warning('Dropping addCommanderCombatInterdiction message because opponentName came out as ""')
|
||||||
'Dropping addCommanderCombatInterdictionEscape message'
|
|
||||||
'because opponentName came out as ""'
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
new_add_event(
|
new_add_event('addCommanderCombatInterdictionEscape', entry['timestamp'], data)
|
||||||
'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