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

added setCommanderTravelLocation from Location event

This commit is contained in:
A_D 2021-06-04 00:15:57 +02:00
parent 8a94a57e78
commit 607729b77b
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -1156,6 +1156,27 @@ def journal_entry( # noqa: C901, CCR001
new_add_event('updateCommanderSuitLoadout', entry['timestamp'], to_send)
elif event_name == "Location":
to_send = {
'starsystemName': entry['StarSystem'],
'starsystemCoords': entry['StarPos'],
}
if entry['Docked']:
to_send['stationName'] = entry['StationName']
to_send['marketID'] = entry['MarketID']
if entry['Docked'] and entry['BodyType'] == 'Planet':
# we're Docked, but we're not on a Station, thus we're docked at a planetary base of some kind
# and thus, we SHOULD include starsystemBodyName
to_send['starsystemBodyName'] = entry['Body']
if 'Longitude' in entry and 'Latitude' in entry:
# These were included thus we are landed
to_send['starsystemBodyCoords'] = [entry['Latitude'], entry['Longitude']]
new_add_event('setCommanderTravelLocation', entry['timestamp'], to_send)
# Community Goals
if event_name == 'CommunityGoal':
# Remove any unsent