3.5 KiB
EDDN FCMaterials Schema
Introduction
This is the documentation for how to take data from an the ED CAPI /market
endpoint and properly structure it for sending to EDDN.
Please consult EDDN Schemas README for general documentation for a schema such as this.
If you find any discrepancies between what this document says and what is defined in the relevant Schema file, then you should, in the first instance, assume that it is the Schema file that is correct. PLEASE open an issue on GitHub to report any such anomalies you find so that we can check and resolve the discrepancy.
Senders
The data source for this schema is the /market
ED CAPI endpoint. You only
want selected parts of the full data returned for this schema.
You MUST NOT construct the message by starting with the entirety of the
CAPI data and then removing everything but what you need. That risks Frontier
adding more data to the endpoint and your fcmaterials_capi
messages being
rejected as invalid. Instead, construct the message content by setting just
the data that is necessary.
Your message
object MUST:
- Have an
"event":"FCMaterials"
member to aid Listeners who pass this through a "usually from the Journal" code path. - Set a
"MarketID"
key with the value from"id"
in the CAPI data. - Set a
"CarrierID"
key with the value from the"name"
in the CAPI data. - Set the
"Items"
key's contents directly from the/market
->orders
->onfootmicroresources
CAPI data. - Remove any data where the key is
"locName"
from the"Items"
data.
You MUST NOT:
- Attempt to set a
"CarrierName"
from any source, theCarrierID
is sufficient.
Example algorithm
- Make a CAPI
/market
query. - Set
event
,MarketID
andCarrierID
as outlined above. - Set
Items
value to the data inorders.onfootmicroresources
. - Process the contents of
Items
, removing any data with a key oflocName
.
Augmentations
horizons and odyssey flags
Please read horizons and odyssey flags in the Developers' documentation.
You SHOULD set these flags from the Journal FileHeader
data if you are
reasonably sure you have a live game session against which you are performing
CAPI queries.
You MUST NOT set them otherwise, as e.g. the player could be active in
the game on another computer, using a different game mode and the CAPI data
will be for that game mode.
gameversion and gamebuild
You MUST always set these as per the relevant section of the Developers' documentation.
Listeners
The advice above for Senders, combined with the actual Schema file should provide all the information you need to process these events.
Do note that the data source for this is the CAPI, and as such the data is not
the same as for the fcmaterials_journal
schema:
- There is no good source of
CarrierName
in CAPI/market
endpoint data, so that is not included. - The
sales
andpurchases
values do not contain the same form of data. - The
sales
member ofItems
will be[]
if there are no sales orders, but when there are orders:- It will be an object/dictionary.
- The keys are the commodity ID.
- The value of that key is the rest of the data for that sales order.
- The
purchases
value:- Is always an array, unlike
sales
. - As a consequence does not provide the commodity id at all, only the name.
- Is always an array, unlike