mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-06 18:33:13 +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:
|
elif 'Power' in entry:
|
||||||
data['opponentName'] = entry['Power']
|
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':
|
elif event_name == 'Interdiction':
|
||||||
data = OrderedDict([
|
data = OrderedDict([
|
||||||
@ -1090,18 +1095,31 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
elif 'Power' in entry:
|
elif 'Power' in entry:
|
||||||
data['opponentName'] = entry['Power']
|
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':
|
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