From 4f3225c3af604f6bbdd2c5380dc0c671766c62f0 Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Thu, 27 Jan 2022 11:10:59 +0000 Subject: [PATCH] Add Approachsettlement --- schemas/approachsettlement-README.md | 33 +++++++++++ schemas/approachsettlement-v1.0.json | 89 ++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 schemas/approachsettlement-README.md create mode 100644 schemas/approachsettlement-v1.0.json diff --git a/schemas/approachsettlement-README.md b/schemas/approachsettlement-README.md new file mode 100644 index 0000000..e4af2af --- /dev/null +++ b/schemas/approachsettlement-README.md @@ -0,0 +1,33 @@ +# EDDN ApproachSettlement Schema + +## Introduction +Here we document how to take data from an ED `FSSAllBodiesFound` Journal +Event and properly structure it for sending to EDDN. + +Please consult [EDDN Schemas README](./README-EDDN-schemas.md) for general +documentation for a schema such as this. + +## Senders +The primary data source for this schema is the ED Journal event +`ApproachSettlement`. + +### Key Renames +Many of the key names have a different case defined in this schema, make +sure you are renaming them as appropriate. + +### Elisions +None + +### Augmentations +#### horizons flag +You SHOULD add this key/value pair, using the value from the `LoadGame` event. + +#### odyssey flag +You SHOULD add this key/value pair, using the value from the `LoadGame` event. + +#### StarSystem + +You MUST add a StarSystem key/value pair representing the name of the system this event occurred in. Source this from either Location, FSDJump or CarrierJump as appropriate. + +#### StarPos +You MUST add a `StarPos` array containing the system co-ordinates from the last `FSDJump`, `CarrierJump`, or `Location` event. diff --git a/schemas/approachsettlement-v1.0.json b/schemas/approachsettlement-v1.0.json new file mode 100644 index 0000000..958d5d3 --- /dev/null +++ b/schemas/approachsettlement-v1.0.json @@ -0,0 +1,89 @@ +{ + "$schema" : "http://json-schema.org/draft-04/schema#", + "id" : "https://eddn.edcd.io/schemas/approachsettlement/1#", + "type" : "object", + "additionalProperties" : false, + "required": [ "$schemaRef", "header", "message" ], + "properties": { + "$schemaRef": { + "type" : "string" + }, + "header": { + "type" : "object", + "additionalProperties" : true, + "required" : [ "uploaderID", "softwareName", "softwareVersion" ], + "properties" : { + "uploaderID": { + "type" : "string" + }, + "softwareName": { + "type" : "string" + }, + "softwareVersion": { + "type" : "string" + }, + "gatewayTimestamp": { + "type" : "string", + "format" : "date-time", + "description" : "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property." + } + } + }, + "message": { + "type" : "object", + "description" : "Contains all properties from the listed events in the client's journal minus the event key, Localised strings and the properties marked below as 'disallowed'", + "additionalProperties" : false, + "required" : [ "timestamp", "StarSystem", "StarPos", "SystemAddress", "Name", "MarketID", "BodyID", "BodyName", "Latitude", "Longitude" ], + "properties" : { + "timestamp": { + "type" : "string", + "format" : "date-time" + }, + "horizons": { + "type" : "boolean", + "description" : "Whether the sending Cmdr has a Horizons pass." + }, + "odyssey": { + "type" : "boolean", + "description" : "Whether the sending Cmdr has an Odyssey expansion." + }, + "StarSystem": { + "type" : "string", + "minLength" : 1 + }, + "StarPos": { + "type" : "array", + "items" : { "type": "number" }, + "minItems" : 3, + "maxItems" : 3, + "description" : "Must be added by the sender" + }, + "SystemAddress": { + "type" : "integer", + }, + "Name" : { + "type" : "string", + "description" : "Name of settlement" + }, + "MarketID": { + "type" : "integer" + }, + "BodyID": { + "type" : "integer" + }, + "BodyName": { + "type" : "string" + }, + "Latitude": { + "type" : "number" + }, + "Longitude": { + "type" : "number" + } + } + } + }, + "definitions": { + "disallowed" : { "not" : { "type": [ "array", "boolean", "integer", "number", "null", "object", "string" ] } } + } +}