From e2f4f8f6651310ece71f4a5a5c10bb299e091023 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 14 Dec 2022 13:51:29 +0000 Subject: [PATCH] PLUGINS.md: Slightly improve CAPI Legacy/Live doc --- PLUGINS.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index ee539032..dc23752d 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -970,8 +970,22 @@ def cmdr_data_legacy(data, is_beta): then you *may* simply: ```python +from companion import SERVER_BETA, SERVER_LEGACY, SERVER_LIVE + def cmdr_data_legacy(data, is_beta): return cmdr_data(data, is_beta) + +def cmdr_data(data, is_beta): + if data.source_host == SERVER_LEGACY: + ... + elif data.source_host == SERVER_LIVE: + ... + elif data.source_host == SERVER_BETA: + # Would also be indicated by `is_beta == True` + ... + else: + # Unknown source galaxy ! + ... ``` The core 'eddn' plugin might contain some useful hints about how to handle the