Skip to content

Commit

Permalink
[EDCD#2157] Add Station and Docking Information When Available
Browse files Browse the repository at this point in the history
  • Loading branch information
Rixxan committed Feb 9, 2024
1 parent c7a3fd4 commit 4a4010a
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions plugins/eddn.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,18 +920,24 @@ def export_journal_commodities(self, cmdr: str, is_beta: bool, entry: Mapping[st
# none and that really does need to be recorded over EDDN so that
# tools can update in a timely manner.
if this.commodities != commodities:
self.send_message(cmdr, {
message: dict[str, Any] = { # Yes, this is a broad type hint.
'$schemaRef': f'https://eddn.edcd.io/schemas/commodity/3{"/test" if is_beta else ""}',
'message': {
('timestamp', entry['timestamp']),
('systemName', entry['StarSystem']),
('stationName', entry['StationName']),
('marketId', entry['MarketID']),
('commodities', commodities),
('horizons', this.horizons),
('odyssey', this.odyssey),
},
})
'timestamp': entry['timestamp'],
'systemName': entry['StarSystem'],
'stationName': entry['StationName'],
'marketId': entry['MarketID'],
'commodities': commodities,
'horizons': this.horizons,
'odyssey': this.odyssey,
'stationType': entry['StationType'],
}
}

if entry.get('CarrierDockingAccess'):
message['message']['carrierDockingAccess'] = entry['CarrierDockingAccess']

self.send_message(cmdr, message)

this.commodities = commodities

Expand Down

0 comments on commit 4a4010a

Please sign in to comment.