mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-12 23:37:14 +03:00
Merge pull request #1735 from EDCD/fix/1732/inara-do-not-send-empty-required
Inara: Drop various combat messages if empty opponentName
This commit is contained in:
commit
4a8b5ed4b6
@ -1072,7 +1072,12 @@ def journal_entry( # noqa: C901, CCR001
|
||||
elif 'Power' in entry:
|
||||
data['opponentName'] = entry['Power']
|
||||
|
||||
new_add_event('addCommanderCombatInterdicted', entry['timestamp'], data)
|
||||
# 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 ""')
|
||||
|
||||
else:
|
||||
new_add_event('addCommanderCombatInterdicted', entry['timestamp'], data)
|
||||
|
||||
elif event_name == 'Interdiction':
|
||||
data = OrderedDict([
|
||||
@ -1090,18 +1095,31 @@ def journal_entry( # noqa: C901, CCR001
|
||||
elif 'Power' in entry:
|
||||
data['opponentName'] = entry['Power']
|
||||
|
||||
new_add_event('addCommanderCombatInterdiction', entry['timestamp'], data)
|
||||
# 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 ""')
|
||||
|
||||
else:
|
||||
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