Inara: queue 'Rank'/'setCommanderRankPilot' as soon as seen

This means we *will* send a message when logging in on foot, rather than
waiting for a `Cargo` event that never arrives.
This commit is contained in:
Athanasius committed 2022-01-25 15:27:35 +00:00
1 parent ded86c2ff5
commit 28cbd6e0ea
1 file changed
+12 -10
+12 -10
View File
@@ -426,16 +426,6 @@ def journal_entry( # noqa: C901, CCR001
this.newuser = False
this.newsession = False
# Send rank info to Inara on startup
new_add_event(
'setCommanderRankPilot',
entry['timestamp'],
[
{'rankName': k.lower(), 'rankValue': v[0], 'rankProgress': v[1] / 100.0}
for k, v in state['Rank'].items() if v is not None
]
)
# Don't send the API call with no values.
if state['Reputation']:
new_add_event(
@@ -503,6 +493,18 @@ def journal_entry( # noqa: C901, CCR001
this.loadout = make_loadout(state)
new_add_event('setCommanderShipLoadout', entry['timestamp'], this.loadout)
# Login-time Ranks
elif event_name == 'Rank':
# Send rank info to Inara on startup
new_add_event(
'setCommanderRankPilot',
entry['timestamp'],
[
{'rankName': k.lower(), 'rankValue': v[0], 'rankProgress': v[1] / 100.0}
for k, v in state['Rank'].items() if v is not None
]
)
# Promotions
elif event_name == 'Promotion':
for k, v in state['Rank'].items():