From b323460bf824771f3655dd243815a31ed0453c95 Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Wed, 26 Jan 2022 17:50:41 +0000 Subject: [PATCH 1/5] Add FSSAllBodiesFound --- schemas/fssallbodiesfound-README.md | 30 ++++++++++++ schemas/fssallbodiesfound-v1.0.json | 75 +++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 schemas/fssallbodiesfound-README.md create mode 100644 schemas/fssallbodiesfound-v1.0.json diff --git a/schemas/fssallbodiesfound-README.md b/schemas/fssallbodiesfound-README.md new file mode 100644 index 0000000..a86db5c --- /dev/null +++ b/schemas/fssallbodiesfound-README.md @@ -0,0 +1,30 @@ +# EDDN FSSAllBodiesFound 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 +`FSSAllBodiesFound`. + +### 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. + +#### StarPos +You MUST add a `StarPos` array containing the system co-ordinates from the +last `FSDJump`, `CarrierJump`, or `Location` event. diff --git a/schemas/fssallbodiesfound-v1.0.json b/schemas/fssallbodiesfound-v1.0.json new file mode 100644 index 0000000..14dc507 --- /dev/null +++ b/schemas/fssallbodiesfound-v1.0.json @@ -0,0 +1,75 @@ +{ + "$schema" : "http://json-schema.org/draft-04/schema#", + "id" : "https://eddn.edcd.io/schemas/fssallbodiesfound/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", "SystemName", "StarPos", "SystemAddress", "Count" ], + "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." + }, + "SystemName": { + "type" : "string", + "minLength" : 1 + }, + "StarPos": { + "type" : "array", + "items" : { "type": "number" }, + "minItems" : 3, + "maxItems" : 3, + "description" : "Must be added by the sender if not present in the journal event" + }, + "SystemAddress": { + "type" : "integer", + "description" : "Should be added by the sender if not present in the journal event" + }, + "Count" : { + "type" : "integer", + "description" : "Number of bodies in this system" + } + } + } + }, + "definitions": { + "disallowed" : { "not" : { "type": [ "array", "boolean", "integer", "number", "null", "object", "string" ] } } + } +} From b6d25ccebcc099ac93173ec50cc07b7a71014dab Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Thu, 27 Jan 2022 11:32:46 +0000 Subject: [PATCH 2/5] Added back in the event key --- schemas/fssallbodiesfound-v1.0.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/schemas/fssallbodiesfound-v1.0.json b/schemas/fssallbodiesfound-v1.0.json index 14dc507..b3a4198 100644 --- a/schemas/fssallbodiesfound-v1.0.json +++ b/schemas/fssallbodiesfound-v1.0.json @@ -31,7 +31,7 @@ }, "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'", + "description" : "Contains all properties from the listed events in the client's journal, minus the Localised strings and the properties marked below as 'disallowed'", "additionalProperties" : false, "required" : [ "timestamp", "SystemName", "StarPos", "SystemAddress", "Count" ], "properties" : { @@ -39,6 +39,9 @@ "type" : "string", "format" : "date-time" }, + "event" : { + "enum" : [ "FSSAllBodiesFound" ] + }, "horizons": { "type" : "boolean", "description" : "Whether the sending Cmdr has a Horizons pass." From d4e7409ae0d79a7e4c00de31c28e8cbd4b0fbb7a Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Thu, 27 Jan 2022 16:28:37 +0000 Subject: [PATCH 3/5] Add to settings.py the fssallbodiesfound schemas --- src/eddn/conf/Settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/eddn/conf/Settings.py b/src/eddn/conf/Settings.py index af15e95..b0782ce 100644 --- a/src/eddn/conf/Settings.py +++ b/src/eddn/conf/Settings.py @@ -76,6 +76,8 @@ class _Settings(object): "https://eddn.edcd.io/schemas/approachsettlement/1" : "schemas/approachsettlement-v1.0.json", "https://eddn.edcd.io/schemas/approachsettlement/1/test" : "schemas/approachsettlement-v1.0.json", + "https://eddn.edcd.io/schemas/fssallbodiesfound/1" : "schemas/fssallbodiesfound-v1.0.json", + "https://eddn.edcd.io/schemas/fssallbodiesfound/1/test" : "schemas/fssallbodiesfound-v1.0.json", } GATEWAY_OUTDATED_SCHEMAS = [ @@ -97,6 +99,8 @@ class _Settings(object): "http://schemas.elite-markets.net/eddn/blackmarket/1/test", "http://schemas.elite-markets.net/eddn/journal/1", "http://schemas.elite-markets.net/eddn/journal/1/test", + "http://schemas.elite-markets.net/eddn/fssallbodiesfound/1", + "http://schemas.elite-markets.net/eddn/fssallbodiesfound/1/test", ] ############################################################################### From de33e4460c246cc6094344a4101d38da43e97add Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 28 Jan 2022 17:26:12 +0000 Subject: [PATCH 4/5] Schemas/FSSAllBodiesFound: Make 'event' required --- schemas/fssallbodiesfound-v1.0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/fssallbodiesfound-v1.0.json b/schemas/fssallbodiesfound-v1.0.json index b3a4198..074362a 100644 --- a/schemas/fssallbodiesfound-v1.0.json +++ b/schemas/fssallbodiesfound-v1.0.json @@ -33,7 +33,7 @@ "type" : "object", "description" : "Contains all properties from the listed events in the client's journal, minus the Localised strings and the properties marked below as 'disallowed'", "additionalProperties" : false, - "required" : [ "timestamp", "SystemName", "StarPos", "SystemAddress", "Count" ], + "required" : [ "timestamp", "event", "SystemName", "StarPos", "SystemAddress", "Count" ], "properties" : { "timestamp": { "type" : "string", From 8db880f95def1f9b22af54bf2cd62a7c029fcf3f Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 28 Jan 2022 17:26:57 +0000 Subject: [PATCH 5/5] schemas/FSSAllBodiesFound: Don't list in outdated schemas --- src/eddn/conf/Settings.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/eddn/conf/Settings.py b/src/eddn/conf/Settings.py index b0782ce..5ca2a6f 100644 --- a/src/eddn/conf/Settings.py +++ b/src/eddn/conf/Settings.py @@ -99,8 +99,6 @@ class _Settings(object): "http://schemas.elite-markets.net/eddn/blackmarket/1/test", "http://schemas.elite-markets.net/eddn/journal/1", "http://schemas.elite-markets.net/eddn/journal/1/test", - "http://schemas.elite-markets.net/eddn/fssallbodiesfound/1", - "http://schemas.elite-markets.net/eddn/fssallbodiesfound/1/test", ] ###############################################################################