1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

Send credits at startup

This commit is contained in:
Jonathan Harris 2018-02-18 02:56:23 +00:00
parent 60ddc55d5e
commit 3a00166621

View File

@ -176,6 +176,15 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
try:
old_events = len(this.events) # Will only send existing events if we add a new event below
# Send credits to Inara on startup only - otherwise may be out of date
if entry['event'] == 'Cargo':
add_event('setCommanderCredits', entry['timestamp'],
OrderedDict([
('commanderCredits', state['Credits']),
('commanderLoan', state['Loan']),
]))
this.lastcredits = state['Credits']
# Send rank info to Inara on startup or change
if (entry['event'] in ['StartUp', 'Cargo'] or this.newuser):
for k,v in state['Rank'].iteritems():