mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
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:
parent
ded86c2ff5
commit
28cbd6e0ea
@ -426,16 +426,6 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
this.newuser = False
|
this.newuser = False
|
||||||
this.newsession = 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.
|
# Don't send the API call with no values.
|
||||||
if state['Reputation']:
|
if state['Reputation']:
|
||||||
new_add_event(
|
new_add_event(
|
||||||
@ -503,6 +493,18 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
this.loadout = make_loadout(state)
|
this.loadout = make_loadout(state)
|
||||||
new_add_event('setCommanderShipLoadout', entry['timestamp'], this.loadout)
|
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
|
# Promotions
|
||||||
elif event_name == 'Promotion':
|
elif event_name == 'Promotion':
|
||||||
for k, v in state['Rank'].items():
|
for k, v in state['Rank'].items():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user