mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-03 17:10:59 +03:00
Inara: Only ApproachSettlement if we have system & fix key case
* If you're near a settlement on login you get an ApproachSettlement before `monitor` has system set to pass into `journal_entry()`. * We had a case-type of an Inara API key, so it wasn't setting the BodyName. * TRACE level logging of what we actually send to Inara.
This commit is contained in:
parent
fa0a7c48a2
commit
f6777f0237
@ -630,6 +630,9 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
new_add_event('setCommanderTravelLocation', entry['timestamp'], to_send)
|
new_add_event('setCommanderTravelLocation', entry['timestamp'], to_send)
|
||||||
|
|
||||||
elif event_name == 'ApproachSettlement':
|
elif event_name == 'ApproachSettlement':
|
||||||
|
# If you're near a Settlement on login this event is recorded, but
|
||||||
|
# we might not yet have system logged for use.
|
||||||
|
if system:
|
||||||
to_send = {
|
to_send = {
|
||||||
'starsystemName': system,
|
'starsystemName': system,
|
||||||
'stationName': entry['Name'],
|
'stationName': entry['Name'],
|
||||||
@ -1197,7 +1200,7 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
# These were included thus we are landed
|
# These were included thus we are landed
|
||||||
to_send['starsystemBodyCoords'] = [entry['Latitude'], entry['Longitude']]
|
to_send['starsystemBodyCoords'] = [entry['Latitude'], entry['Longitude']]
|
||||||
# if we're not Docked, but have these, we're either landed or close enough that it doesn't matter.
|
# if we're not Docked, but have these, we're either landed or close enough that it doesn't matter.
|
||||||
to_send['starSystemBodyName'] = entry['Body']
|
to_send['starsystemBodyName'] = entry['Body']
|
||||||
|
|
||||||
new_add_event('setCommanderTravelLocation', entry['timestamp'], to_send)
|
new_add_event('setCommanderTravelLocation', entry['timestamp'], to_send)
|
||||||
|
|
||||||
@ -1483,6 +1486,7 @@ def new_worker():
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
logger.info(f'sending {len(data["events"])} events for {creds.cmdr}')
|
logger.info(f'sending {len(data["events"])} events for {creds.cmdr}')
|
||||||
|
logger.trace(f'Events:\n{json.dumps(data)}\n')
|
||||||
try_send_data(TARGET_URL, data)
|
try_send_data(TARGET_URL, data)
|
||||||
|
|
||||||
time.sleep(WORKER_WAIT_TIME)
|
time.sleep(WORKER_WAIT_TIME)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user