From 9a6b59fbd36f4f8a5f49bc3c7bcc55e00274a4f5 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 12 Apr 2021 09:10:25 +0100 Subject: [PATCH] monitor.py: Initialise EDLogs self.systempopulation This is the *one* field that wasn't always initialised. --- PLUGINS.md | 3 +++ monitor.py | 1 + 2 files changed, 4 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index 23016a2b..e327e1da 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -563,6 +563,9 @@ running. In this case you won't receive initial events such as "LoadGame", "Rank", "Location", etc. However the `state` dictionary will reflect the cumulative effect of these missed events. +**NB: Any of the values in this might be `None` if the Cmdr has loaded into +Arena (CQC) from the Main Menu.** + Similarly, a special "ShutDown" entry is sent when the game stops writing to the Journal without writing a "Shutdown" event. This might happen, for example, when the game client crashes. diff --git a/monitor.py b/monitor.py index 15e5dd50..7f0a1ae7 100644 --- a/monitor.py +++ b/monitor.py @@ -105,6 +105,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below self.stationtype: Optional[str] = None self.coordinates: Optional[Tuple[float, float, float]] = None self.systemaddress: Optional[int] = None + self.systempopulation: Optional[int] = None self.started: Optional[int] = None # Timestamp of the LoadGame event self.__init_state()