1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-05 09:53:33 +03:00

Merge pull request #1316 from EDCD/fix/1018/update-and-docked-status

CAPI: Avoid '... EDO Settlement?' for 'Update' in space
This commit is contained in:
Athanasius 2021-10-20 15:05:28 +01:00 committed by GitHub
commit 8d55e9f02c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1072,24 +1072,13 @@ class AppWindow(object):
f"{monitor.state['OnFoot']!r} and {monitor.station!r}") f"{monitor.state['OnFoot']!r} and {monitor.station!r}")
raise companion.ServerLagging() raise companion.ServerLagging()
else: elif capi_response.capi_data['commander']['docked'] and monitor.station is None:
last_station = None # Likely (re-)Embarked on ship docked at an EDO settlement.
if capi_response.capi_data['commander']['docked']: # Both Disembark and Embark have `"Onstation": false` in Journal.
last_station = capi_response.capi_data['lastStarport']['name'] # So there's nothing to tell us which settlement we're (still,
# or now, if we came here in Apex and then recalled ship) docked at.
if monitor.station is None: logger.debug("docked AND monitor.station is None - so EDO settlement?")
# Likely (re-)Embarked on ship docked at an EDO settlement. raise companion.NoMonitorStation()
# Both Disembark and Embark have `"Onstation": false` in Journal.
# So there's nothing to tell us which settlement we're (still,
# or now, if we came here in Apex and then recalled ship) docked at.
logger.debug("monitor.station is None - so EDO settlement?")
raise companion.NoMonitorStation()
if last_station != monitor.station:
# CAPI lastStarport must match
logger.warning(f"({capi_response.capi_data['lastStarport']['name']!r} != {monitor.station!r})"
f" AND {last_station!r} != {monitor.station!r}")
raise companion.ServerLagging()
self.capi_query_holdoff_time = capi_response.query_time + companion.capi_query_cooldown self.capi_query_holdoff_time = capi_response.query_time + companion.capi_query_cooldown