From 70016b44b17756004f3a4525c4daf63d87fc316f Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Tue, 25 Jul 2023 21:28:58 +0800 Subject: [PATCH] EDDN.php: import coordinates from NavRoute This is half of #1. No idea how to do the body part yet. --- EDDN.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/EDDN.php b/EDDN.php index 69d8df7..a1341d4 100644 --- a/EDDN.php +++ b/EDDN.php @@ -25,12 +25,14 @@ 'https://eddn.edcd.io/schemas/outfitting/2', 'https://eddn.edcd.io/schemas/blackmarket/1', 'https://eddn.edcd.io/schemas/journal/1', + 'https://eddn.edcd.io/schemas/navroute/1', 'https://eddn.edcd.io/schemas/commodity/3/live', 'https://eddn.edcd.io/schemas/shipyard/2/live', 'https://eddn.edcd.io/schemas/outfitting/2/live', 'https://eddn.edcd.io/schemas/blackmarket/1/live', 'https://eddn.edcd.io/schemas/journal/1/live', + 'https://eddn.edcd.io/schemas/navroute/1/live', ); /** @@ -144,6 +146,21 @@ EDSM_Api_Logger::log('Unknown journal event (' . $schemaRef . ' [' . $message['event'] . ']).'); } + // Navroute + if(strpos($schemaRef, '/navroute/1') !== false) + { + if(array_key_exists('Route', $message)) + { + foreach($message['Route'] as $node) + { + $systemId = \EDDN\System\Coordinates::handle($node, $header['softwareName'], $header['softwareVersion'], false, true); + // TODO: Make use of StarClass + } + } + + continue; + } + // Stations commodities if(strpos($schemaRef, '/commodity/3') !== false) { @@ -244,4 +261,4 @@ } // Exit correctly -exit(0); \ No newline at end of file +exit(0);