From 5f29c866e7b2658d6baa14fdeff5017b6b6483dd Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 5 May 2021 11:34:10 +0100 Subject: [PATCH 1/2] Dropship: Set OnFoot for DropshipDeploy, but ignore BookDropship See the comment added to BookDropship code for why we're ignoring it. --- monitor.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/monitor.py b/monitor.py index 2d87c33f..73fb9c83 100644 --- a/monitor.py +++ b/monitor.py @@ -687,6 +687,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below self.state['OnFoot'] = True + elif event_type == 'DropshipDeploy': + # We're definitely on-foot now + self.state['OnFoot'] = True + elif event_type in ('Location', 'FSDJump', 'Docked', 'CarrierJump'): # alpha4 - any changes ? # Location: @@ -1196,6 +1200,16 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below elif event_type == 'BookDropship': self.state['Credits'] -= entry['Cost'] + # Technically we *might* now not be OnFoot. + # The problem is that this event is recorded both for signing up for + # an on-foot CZ, and when you use the Dropship to return after the + # CZ completes. + # + # In the first case we're still in-station and thus still on-foot. + # + # In the second case we should instantly be in the Dropship and thus + # not still on-foot, BUT it doesn't really matter as the next significant + # event is going to be Disembark to on-foot anyway. elif event_type == 'BookTaxi': self.state['Credits'] -= entry['Cost'] From 692856bbe1a41f51f27a64dcb6009fd012c9f675 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 5 May 2021 11:42:29 +0100 Subject: [PATCH 2/2] Disembark: Use the alpha4-new flag to detect if on-station --- monitor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/monitor.py b/monitor.py index 73fb9c83..43170e2b 100644 --- a/monitor.py +++ b/monitor.py @@ -661,8 +661,6 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below self.state['OnFoot'] = False elif event_type == 'Disembark': - # We don't yet have a way, other than LoadGame+Location, to detect if we *are* on a station on-foot. - # alpha4 # This event is logged when the player steps out of a ship or SRV # # Parameters: @@ -680,9 +678,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below # • StationType # • MarketID - # If we're not exiting one of these then it's from our own ship, and then we should already have - # self.station set correctly. - if entry['SRV'] or entry['Taxi'] or entry['Multicrew']: + if entry.get('OnStation', False): + self.station = entry.get('StationName', '') + + else: self.station = None self.state['OnFoot'] = True